1 2 3 4 5 6 7 8 9 10
| Before heapify: [100, 92, 84, 76, 68, 60, 52, 44, 36, 28, 20, 12, 4] After heapify: [4, 20, 12, 36, 28, 60, 52, 44, 76, 92, 68, 84, 100] After heappush: [1, 20, 4, 36, 28, 60, 12, 44, 76, 92, 68, 84, 100, 52] smallest elements is: 1 After heappushpop [12, 20, 52, 36, 28, 60, 1000, 44, 76, 92, 68, 84, 100] second small element is: 4 After heapreplace [20, 28, 52, 36, 45, 60, 1000, 44, 76, 92, 68, 84, 100] second small element is: 12 top 3 big elements is: [1000, 100, 92] top 3 small elements is: [20, 28, 36]
|