Created
June 8, 2020 09:48
-
-
Save mzaks/4266f593254d97a6d180134e1c92e91d to your computer and use it in GitHub Desktop.
compare binary search with eytzinger
This file contains hidden or 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
let now = Instant::now(); | |
for (index, e) in vec_clone.iter().enumerate() { | |
assert_eq!(first_index_for_eytzinger(&vec_clone, e).expect(""), index) | |
} | |
let eytz_search = now.elapsed(); | |
let now = Instant::now(); | |
for (index, e) in vec_unstable.iter().enumerate() { | |
assert_eq!(vec_unstable.binary_search(e).expect(""), index) | |
} | |
let binary_search = now.elapsed(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment