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
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.
How do you explain polymorphism?
What is abstraction and encapsulation?
what is the sylabus for priliminaries?
to find out the minimum of two integer number of two different classes using friend function
What is byval and byref? What are differences between them?
Why do we use polymorphism in oops?
What is object in oop with example?
Get me an image implementation program.
what type of question are asked in thoughtworks pair programming round ?
What is encapsulation example?
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What are the features of oop?
write knight tour problem which is present in datastructure