Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

Data Structures :: Searching & Sorting

Home > Data Structures > Searching & Sorting > General Questions

1. Which of the following algorithmic paradigm is used in the merge sort?

Answer: Divide and Conquer

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

2. What is the worst case performance of Selection sort algorithm?

Answer: O(n* n)

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

3. Let P be a quick sort program to sort numbers in ascending order using the first element as the pivot. Let t1 and t2 be the number of comparisons made by P for the input [1 2 3 4 5] and [4 1 5 3 2] respectively. Which one of the following holds?

Answer: t1 > t2

Explanation:

When first element or last element is chosen as pivot, Quick Sort's worst case occurs for the sorted arrays.

In every step of quick sort, numbers are divided as per the following recurrence.

T(n) = T(n-1) + O(n)

Workspace

Tags:

No Tags on this question yet!

4. Consider the C function given below. Assume the array listA contains (n>0) elements, sorted in ascending order.

int Process array (int * list A, int x, int n)
{
int i, j, k;
i =0;j=n-1;
do {
k = (i+j)/2;
if (x<=list A[k])
j=k-1;
if (list A[k] <=x)
i =k+1;
} while (i <=j);
if (list A[k] == x)
return (k);
else
return -1;
}

Which oe of the following statements about the function Process Array is CORRECT?

Answer: It is an implementation of binary search.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

5. What sorting algos have their best and worst case times equal ?

Answer: merge sort and heap sort

Explanation:

O(nlogn) for mergesort and heap sort

Workspace

Tags:

No Tags on this question yet!

6. What data structures you should use for dictionary searching and it should be capable of doing spell check also ?

Answer: Hashing

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

7. In worst case Quick Sort has order

Answer: O[n^2)/2]

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

8. A sort which relatively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called

Answer: quick sort.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

9. Which of the following sorting algorithms does not have a worst case running time of O(n^2)?

Answer: Merge sort

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

10. The quick sort algorithm exploit _________ design technique

Answer: Divide and Conquer

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!