Searching
Linear | Binary | Hashing | |
---|---|---|---|
Time Complexity | |||
Space Complexity | |||
Pros | - Easy to implement - Works on unsorted arrays | Faster | - Fastest - Easy to implement |
Cons | Slow | - Require pre-sorted - Can be tricky to implement | Consume additional space |
Used in | Small one-pass searching | Large one-pass searching | Search is called multiple times |