functions (3.papers)

loops (1.papers)

Conditional statements (2.papers)

arrays (2.papers)

structures (3.papers)

unions (1.papers)

Enums and TypeDefs (3.papers)

pointers (7.papers)

null pointers (1.papers)

strings (2.papers)

misc c concepts (1.papers)

Data structures (5.papers)

linked lists (3.papers)

trees (1.papers)

basics (5.papers)

bitwise operators (1.papers)

Show Answer

Show Answer

3

which of the below statements are true about a quick sort? i. select pivot always should be the first element ii. we can select pivot element by using any random order iii. select pivot always should be the last element

i

ii

iii

either option i or option iii are correct

Show Answer

Show Answer

5

What is the run time complexity of quick sort, if array is already in sorted order?

if array is already in sorted order, then quick sort will always run in O(n^2)

if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is starting element.

if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is random element.

if array is already in sorted order, still quick sort will run in O(n log n)

Show Answer

6

What is the difference between bucket sort and counting sort?

counting sort - takes more memory for arrays compared to bucket. Bucket sort - is less efficient for linked lists compared to counting sort.

counting sort - takes less memory for arrays compared to bucket. Bucket sort - is less efficient for linked lists compared to counting sort.

counting sort - takes more memory for arrays compared to bucket. Bucket sort - is more efficient for linked lists compared to counting sort.

counting sort - takes less memory for arrays compared to bucket. Bucket sort - is more efficient for linked lists compared to counting sort.

Show Answer

7

Radix sort: which of the below options are true about radix sort? i. radix sort on elements of range from 0...to..9999, will require always 9999 buckets. we can't use less than this many no of buckets. ii. radix sort will be faster if we use less no of buckets. example radix sort using 10 buckets to sort elements of range 0..to..99 is faster than radix sort using 99 buckets. iii. radix sort will be faster if we use more no of buckets. example radix sort using 10 buckets to sort elements of range 0..to..99 is slower than radix sort using 99 buckets.

i

ii

iii

either option i & ii or correct, or option i & iii are correct.

Show Answer

8

Which of the below sorting algorithms are not done in in-place? (in-place means doing sorting in the same array and not taking extra array or taking too much of extra space).

insertion sort

selection sort

quick sort

merge sort

Show Answer

Show Answer

10

What is heap sort and merge sort? which of the below statements are true about heap sort, and merge sort?

merge sort is - recursive merging quick sort is - recursive partitioning

merge sort is - recursive partitioning quick sort is - recursive partitioning

merge sort is - recursive partitioning quick sort is - recursive merging

merge sort is - recursive merging quick sort is - recursive merging

Show Answer

11

What is the difference between quick sort and merge sort?

Merge sort - first we will merge the unsorted list, and then sort. Quick sort - first we will sort recursively and then partition the arrays.

Merge sort - first we will sort smaller lists, and then merge into bigger list. Quick sort - first we will sort recursively and then partition the arrays.

Merge sort - first we will sort smaller lists, and then merge into bigger sorted list. Quick sort - first we will recursively partition, and then recursively sort.

Merge sort - first we will sort smaller lists, and then merge into bigger list. Quick sort - first we will recursively sort, and then recursively partition bigger arrays.

Show Answer

Show Answer

13

what is the below sorting algorithm? algorithm: - start with unsorted list Z of n items - break into middle Z1, Z2. (EACH have n/2 items) - sort Z1 recursively yielding S1. - sort Z2 recursively yielding S2. - then club S1, S2 into sorted list S.

heap sort

quick sort

merge sort

radix sort

Show Answer