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
Answer Posted / 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 |
Post New Answer View All Answers
How is class defined?
Why do we use class?
What is multilevel inheritance explain with example?
to find out the minimum of two integer number of two different classes using friend function
What is polymorphism and why is it important?
Give two or more real cenario of virtual function and vertual object
Why is polymorphism used?
Can a varargs method be overloaded?
Write a c++ program to display pass and fail for three student using static member function
What is encapsulation selenium?
write a C++ program for booking using constructor and destructor.
Why do we use polymorphism?
What does <> mean pseudocode?
What are the three main types of variables?
What is overloading in oop?