Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Data structures

Rating
-
Sold
-
Pages
6
Uploaded on
15-05-2024
Written in
2023/2024

Data structures are the building blocks of computer programs, providing organized methods for storing, managing, and accessing data efficiently. They range from simple arrays and linked lists to more complex structures like trees and graphs, each serving specific purposes in solving computational problems. Understanding data structures is crucial for designing efficient algorithms and creating robust software applications.

Show more Read less
Institution
Course

Content preview

What is Binary Search | Binary Search Algorithm with example | Data Structures Tutorials

Binary Search Algorithm Principles



Divide and Conquer Technique



Basic principle of Binary Search



Divide the problem into smaller sub-problems



Conquer the sub-problems recursively



Combine the solutions of sub-problems to get the solution of the original problem



Time Complexity of Binary Search



O(log n) in average and worst-case scenarios



Efficient for large data sets



Significantly faster than linear search



Principles of Binary Search Algorithm



Sort the input data before searching

, Use a divide and conquer approach



Compare the search value with the middle element of the current interval



If the search value is equal to the middle element, return its index



If the search value is less than the middle element, repeat the process with the left half



If the search value is greater than the middle element, repeat the process with the right half



If the interval becomes empty, the search value is not in the array



Log N Time Complexity



Time complexity proportional to the logarithm of the input size



Result of dividing the problem into smaller sub-problems at each iteration



Key advantage of the binary search algorithm



Divide and Conquer Technique



Time Complexity of Binary Search



Binary search has a time complexity of O(log N)

Written for

Institution
Course

Document information

Uploaded on
May 15, 2024
Number of pages
6
Written in
2023/2024
Type
SUMMARY

Subjects

$20.69
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
deepakmg

Get to know the seller

Seller avatar
deepakmg PSG
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions