Project for DataStructure, implemented several search algorithms
Sequential Search Binary Search Red/Black Tree AVL Tree Hash
Ubuntu16.04
QT 5.10.1
Qt Creator 4.5
- O(n)
- Slow, with many operations
- O(logn)
- Divisoin is expensive, we can use shift to replace it. mid = (left +right) / 2 -> mid = (left + right) >> 1
- optimizing methods: Fibonacci Search
- O(1)
- Hash function for string
- the cost for saving is high
- O(logn)
- Binary Search Tree
- AVL Tree
- Red/Black Tree