mirror of
				https://github.com/pocketpy/pocketpy
				synced 2025-10-31 08:50:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			9 lines
		
	
	
		
			180 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
		
			180 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from heapq import heapify, heappop, heappush
 | |
| from random import randint
 | |
| 
 | |
| a = [randint(0, 100) for i in range(1000)]
 | |
| b = sorted(a)
 | |
| 
 | |
| heapify(a)
 | |
| for x in b:
 | |
|     assert heappop(a) == x |