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 |
explain sub-type and sub class? atleast u have differ it into 4 points?
What is Hashing and how is it done? Pictorial form?
What is Virtual Keyword?
all about pointers
When is a memory allocated to a class?
What is the difference between inheritance and polymorphism?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
Give two or more real cenario of virtual function and vertual object
Why we are use # in begning of programme of c++.
#include <iostream> using namespace std; int main() { int a = 3; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][2]; }
what is the 3 types of system development life cycle
me get an assignent n its question is this 1.creat a set as in math i.ea={1,2} 2.insert element in it3. delete element don,t repeat any element 4.union 5. intersection of two sets plz help me i always pray for u n send me at ayeshawzd@hotmail.com f u have c++ how to program 5th addition then it is the 10.9 question in 10th chapter exercise