বিভিন্ন পরিস্থিতিতে, আমরা কিছু কী খুঁজে পেতে ভিন্ন সার্চিং স্কিম ব্যবহার করি। এই সেকশনে আমরা দুটি সার্চিং টেকনিক, সিকোয়েনশিয়াল সার্চ এবং বাইনারি সার্চের বেসিক পার্থক্য দেখব।
| Sequential Search | Binary Search |
|---|---|
| Time complexity is O(n) | Time complexity is O(log n) |
| Finds the key present at first position in constant time | Finds the key present at center position in constant time |
| Sequence of elements in the container does not affect. | The elements must be sorted in the container |
| Arrays and linked lists can be used to implement this | It cannot be implemented directly into the linked list. We need to change the basic rules of the list to implement this |
| Algorithm is iterative in nature | Algorithm technique is Divide and Conquer. |
| Algorithm is easy to implement, and requires less amount of code. | Algorithm is slightly complex. It takes more amount of code to implement. |
| N number of comparisons are required for worst case. | Log n number of comparisons are sufficient in worst case. |