what is a complexity of linear search,binery search?

Answer Posted / pratik wavhal

For Linear Search Complexity Is :- O(n).
For Binary Search Complexity Is :- O(log(at base 2)n).

Is This Answer Correct ?    8 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?

627


Explain what is the bucket size, when the overlapping and collision occur at same time?

576


What is bubble sort used for?

459


What are scalar values?

499


How many types of searching are there in data structure?

432






What are the properties of an algorithm?

509


Define path in a graph?

518


Can treemap key null?

587


How to create your own data structure in java?

506


What are the types of algorithms?

553


What is difference between data type and variable?

470


Why do we need searching algorithms?

614


How do you find the number of comparisons in bubble sort?

512


Which sorting algorithm has minimum number of swaps?

510


What is a treeset?

485