This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def performance_time(func, n): | |
start_time = time.time() | |
func(random_list(n)) | |
end_time = time.time() | |
print(end_time - start_time) |
![shiba.gif](https://gist.github.com/Chuncheonian/0b458eb00f72d648e65d69ab08ca16b8/raw/91dfc8ec23b03cae760d6635d397aaf879f51c16/shiba.gif)
![welcome.gif](https://gist.github.com/Chuncheonian/54d8477af6a04c7a7448afeaca1bd29a/raw/188c572a3e0efb3d4ebb9939c504b6561a0c54df/welcome.gif)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Heap<T: Comparable> { | |
private var elements: [T] = [] | |
/// > : Max Heap | |
/// < : Min Heap | |
private let priorityFunction: (T, T) -> Bool | |