what is a complexity of linear search,binery search?
Answers were Sorted based on User's Feedback
Answer / geetika sharma
No, Above answer is wrong. The complexity of Linear search
is O(n) and
Binary search is O(log n) at the base 2
Is This Answer Correct ? | 212 Yes | 9 No |
Answer / saurabh teotia
the complexity of linear search is o(n) n that of binary search is o(logn)
Is This Answer Correct ? | 66 Yes | 5 No |
Answer / guest
in linear search each element in the array should be checked
until the required element got searched whereas in binary
search array is divided into two and required element is
searched
Is This Answer Correct ? | 28 Yes | 1 No |
Answer / lokesh bhatt
o(n)= linear
o(log n)(base 2)= binary
bcz in linear v search one be one while in binary v divide array in two part every time
Is This Answer Correct ? | 15 Yes | 4 No |
Answer / 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 |
Answer / shailja thakur
oops........u all guys are duffers ....u have to clear your all concepts..but u can't....bt better luck for next time...go back to your study and work hard .and right answer is 0..:P
Is This Answer Correct ? | 5 Yes | 6 No |
Answer / naresh kumar
complexity of linear search 0
n binary search 0log(n)
Is This Answer Correct ? | 14 Yes | 31 No |
Answer / hemant belwal
linear search=n/2
binary search=iog2n,2 in the base of log.
Is This Answer Correct ? | 36 Yes | 91 No |
1) Program A and B are analyzed and found to have worst- case running times no greater than 150nlog2n and n2 respectively.Answer the folloWing questions if possible.. i) which program has the better guarantee on the running time,for larger values of n(n>10000) ? ii) which program has the better guarantee on the running time,for small values of n(n<100) ? iii) which program will run faster on average for n =1000 2) wRite a program to compute the number of collisions required in a long random sequence of insertions using linear probing ,quadratic probing and double hashing 3) what is the optimal way to compute A1 A2 A3 A4 A5 A6 where the dimensions of the matrices are A1:10*20 A2 : 20 * 1 A3 : 1 * 40 A4 : 40*5 A5 : 5 * 30 A6 : 30 X 15
What is the use of tree data structure?
Which is better hashset or treeset?
Define a linear and non linear data structure.
Define right-in threaded tree?
What is the difference between hashset and treeset?
Tell me is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
Briefly explain recursive algorithm 50 how do you search for a target key in a linked list?
Which type of efficient data structure is used in the internal storage representation in RDBMS?
How do signed and unsigned numbers affect memory?
What is sorting problem?
What do you mean by rehashing?