Vous êtes sur la page 1sur 3

DATA STRUCTURE

1. Selection sort and quicksort both fall into the same category of sorting algorithms. What is this category? a. O (n log n) sorts b. Divide-and-conquer sorts c. Interchange sorts d. Average time is quadratic 2. Which is the best data structure for round robin algorithm for CPU scheduling? ? a. Stack implemented using queues b. Doubly linked list c. Circular queue d. Queue implemented using stacks 3. Consider the following set of integers. {20,25,57,48,37,12,92,86,33} If one uses the quick sort algorithm to sort the above set of integers, how many pivot elements to completely sort the file? Note: you may choose middle element as a pivot. ? a. 5 b. 8 c. 3 d. 9 4. The time complexity of insertion sort in worst case is? ? a. n(n-1)/4 b. n(n+1)/4 c. n(n-1)/2 d. n(n+1)/2 5.Which among the following are applications of queues ? a. Queues keep track of events waiting to be handled, like multiple button clicks b. Queues are used for evaluation of arithmetic expressions c. Queues are used in parsing d. Queues keep track of processes waiting for a turn in the CPU 6.What does the following function return, if q contains the address of the first element in int function(NODE *q) { int c = 0; while( q != NULL) { q = q->link; c++; } return (c); }

a. b. c. d.

The value of the last node of the linked list The number of elements in a linked list The value of the first elements of the linked list The address of the last element of the linked list

7. Which among the following are applications of queues ? a. Queues keep track of processes waiting for a turn in the CPU b. Queues are used in parsing c. Queues are used for evaluation of arithmetic expressions d. none 8. Which algorithm is having highest space complexity? a. Quick Sort b. Bubble sort c. Merge Sort d. Insertion Sort 9. cocktail sort is a variation of a. bubble sort b. insertion sort c. quick sort d. radix sort 10. which of the following is in place sorting a. quick sort b. heap c. radix d. bucket 11.insertion sort is not a. stable sort b. inplace sort c. online sort d. none 12. library sort is based on which sorting algo a. bubble b. insertion c. merge d. heap 13. in worst case count sort has complexity a. o(n) b. o(nlog n) c. o(n*n) d. none 14. which sorting algo has minimum no. of write operations involved a. quick sort

b. insertion c. radix d. selection 15. online algo is a. which does not take extra memory b. which process input piece by piece in a serial fashion c. do all operation in memory d. none

Vous aimerez peut-être aussi