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
What is the example of polymorphism?
What is inheritance write a program to show use of inheritance?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
Can a varargs method be overloaded?
State what is encapsulation and friend function?
What are the types of abstraction?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
Why polymorphism is used in oops?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
2. Give the different notations for the class.\
What is encapsulation c#?
How do you answer polymorphism?
What is balance factor?
How to hide the base class functionality in Inheritance?
How do you use inheritance in unity?