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


Please Help Members By Posting Answers For Below Questions

Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1377


What is the example of polymorphism?

743


What is methods in oop?

743


What is byval and byref? What are differences between them?

1949


What is abstraction in oops?

788


What are functions in oop?

776


What does I oop mean?

831


What are the advantages of polymorphism?

758


What is abstraction and encapsulation?

772


what are the realtime excercises in C++?

2545


What is the difference between inheritance and polymorphism?

793


What is static in oop?

822


What do you mean by variable?

756


What causes polymorphism?

810


Explain virtual inheritance?

887