Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. โ€บ
  3. posts
  4. โ€บ
  5. โ€ฆ

  6. โ€บ
  7. 5 Searching

Loading โณ
Fetching content, this wonโ€™t take longโ€ฆ


๐Ÿ’ก Did you know?

๐ŸŒ Bananas are berries, but strawberries are not.

๐Ÿช This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Loading โณ
Fetching content, this wonโ€™t take longโ€ฆ


๐Ÿ’ก Did you know?

๐ŸŒ Bananas are berries, but strawberries are not.
Programming

    AI-AgenticAI

    AI-DeepLearning

    AI-GenAI

    AI-Infrastructure

    AI-Machine-Learning

    AI-Math

    AWS

    Azure

    kubernetes

    Management

    Programming
    • ๐Ÿงฑ Data Structures: Arrays, Stacks, Queues, Heaps, Hash Tables, Tries & Graphs

    • ๐ŸŒฒ Trees Deep Dive: BST, AVL Rotations, Red-Black Trees, B-Trees & B+ Trees

    • ๐Ÿ•ธ๏ธ Graph Data Structures: Adjacency List vs Matrix, BFS & DFS

    • ๐Ÿ”ข Algorithmic Complexity: Big O From First Principles

    • ๐Ÿ”Ž Searching Algorithm Complexity ๐Ÿ“–

    • โšก Sorting Algorithm Complexity ๐Ÿ“–

    • ๐Ÿ—„๏ธ Database Comparison ๐Ÿ“–

    • Ansible: Agentless Configuration Management

    • CI/CD Pipelines: From Commit to Production

    • Unix Internals: Processes, File Descriptors, and Syscalls

    • Programming Index


    Terraform

    Z_Appendix

Cover Image for ๐Ÿ”Ž Searching Algorithm Complexity ๐Ÿ“–
Programming

๐Ÿ”Ž Searching Algorithm Complexity ๐Ÿ“–

Best, average, and worst case complexity for linear search, binary search, hashing, and balanced-tree based search โ€” quick revision notes with when to use each.

Algorithms
Searching
Big O
Complexity
Study Notes
โ† Previous

๐Ÿ”ข Algorithmic Complexity: Big O From First Principles

Next โ†’

โšก Sorting Algorithm Complexity ๐Ÿ“–

๐Ÿ”Ž Searching Algorithm Complexity

# Algorithm โฑ๏ธ Best โš–๏ธ Average ๐Ÿ”ป Worst ๐Ÿ’พ Space โš™๏ธ Stability
1๏ธโƒฃ ๐Ÿšถโ€โ™‚๏ธ Linear Search O(1) O(n) O(n) O(1) โœ… Yes
2๏ธโƒฃ ๐ŸŽฏ Binary Search O(1) O(log n) O(log n) O(1) โœ… Yes
3๏ธโƒฃ ๐Ÿชœ Jump Search O(1) O(โˆšn) O(โˆšn) O(1) โœ… Yes
4๏ธโƒฃ ๐Ÿงฉ Interpolation Search O(1) O(log log n) O(n) O(1) โœ… Yes
5๏ธโƒฃ โšก Exponential Search O(1) O(log n) O(log n) O(1) โœ… Yes
6๏ธโƒฃ ๐Ÿงฎ Fibonacci Search O(1) O(log n) O(log n) O(1) โœ… Yes
7๏ธโƒฃ ๐Ÿ”ข Hashing Search O(1) O(1) O(n) O(n) โœ… Yes
8๏ธโƒฃ ๐ŸŒณ Binary Search Tree (BST) O(1) O(log n) O(n) O(n) โœ… Yes
9๏ธโƒฃ ๐ŸŒฒ Balanced BST (AVL, Red-Black) O(1) O(log n) O(log n) O(n) โœ… Yes

Notes

  • Binary Search requires sorted data.
  • Hashing gives average constant-time lookup but degrades to O(n) on collisions.
  • Balanced Trees ensure logarithmic performance by maintaining structure.
  • Jump and Interpolation searches are useful for uniformly distributed data.

Related Posts

  • ๐Ÿงฑ Data Structures & Big O Complexity โ€” the underlying structures (arrays, BSTs, hash tables) these search algorithms run against
  • โšก Sorting Algorithm Complexity โ€” Binary Search's sorted-data prerequisite is what a sorting algorithm provides
Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Fri Feb 20 2026

Share This on

โ† Previous

๐Ÿ”ข Algorithmic Complexity: Big O From First Principles

Next โ†’

โšก Sorting Algorithm Complexity ๐Ÿ“–

Programming/5-Searching
Let's work together
+49 176-2019-2523
hiteshkrsahu@gmail.com
WhatsApp
Skype
Munich ๐Ÿฅจ, Germany ๐Ÿ‡ฉ๐Ÿ‡ช, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
ย  Home/About
ย  Skills
ย  Work/Projects
ย  Lab/Experiments
ย  Contribution
ย  Awards
ย  Art/Sketches
ย  Thoughts
ย  Contact
Links
ย  Sitemap
ย  Legal Notice
ย  Privacy Policy

Made with

NextJS logo

NextJS by

hitesh Sahu

| ยฉ 2026 All rights reserved.