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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

647


How do you explain polymorphism?

600


What is abstraction and encapsulation?

582


what is the sylabus for priliminaries?

1698


to find out the minimum of two integer number of two different classes using friend function

1645






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

1699


Why do we use polymorphism in oops?

592


What is object in oop with example?

715


Get me an image implementation program.

1567


what type of question are asked in thoughtworks pair programming round ?

1767


What is encapsulation example?

556


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

948


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

1155


What are the features of oop?

645


write knight tour problem which is present in datastructure

2172