should we use linear search or binary search if elements
are placed in random order or mixed?in both cases? i need a
little bit detail ans?thnks
Answers were Sorted based on User's Feedback
Answer / indira
We have to use Linear Search only when elms r in random or
mixed .
In order to use Binary Search u have to sort these elems
whose order of complexity is n2.
so its better to use linear search whose complexity is of o(n)
Is This Answer Correct ? | 14 Yes | 1 No |
Answer / pavan
binary search tecqnique is applicable only to sorted
elements because we find the mid value and then cmp it with
the key and if the key is greater than the mid value then
we scan on towards the right else towards the left
so,hencefort itwe should make use of linear search when the
elements r not sorted
Is This Answer Correct ? | 8 Yes | 0 No |
i got a backdoor offer in process global,Bangalore..Can i work with it?
what is the new version of oops
What is abstraction and encapsulation?
what is SPL in c++.
c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess
What is function overloading and operator overloading?
Who invented oop?
create a c++ program that will accepts 9 inputs using 3 by 3 array.
explain dynamic binding by drowing
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
Write a program to reverse a string using recursive function?