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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
How compiler selects(internally) required overridden function in inheritance?
2 Answers CSC, Infinite Computer Solutions,
What is overriding vs overloading?
What is OOPS and How it is different from Procedural Programming ?
23 Answers HP, Infosys, Thyrocare,
I am developing a payroll system mini project.I used file concept in program for reading and writing.When the program is reloading into the memory that is if i execute next time the file was cleaned and adding data from the starting this is my problem.I want to strore the previous data and if i want to add any record that should be next of previous data.Please help me.
what is virtual function?
26 Answers Aspire, HP, Infosys, RoboSoft, TCS,
what about you? wahat is your object? introduce your self?
1 Answers Ajmal Perfumes, TCS,
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
What is the default size allocated for array in the statement if size not specified " int a[] "
What are the types of abstraction?
write string class as your own class in java without using any built-in function
Get me an image implementation program.
What is the real time example of inheritance?