Data structure Quiz 2 - Solved

  1. No. of elements in the linear Queue with pointers REAR & FRONT at any given instant can be given by formula ………………………………
  1. If n is the size of array, maximum no. of elements that can be stored in the circular queue is………………..
  1. The property of which data structure matches with that of Priority queue?

 

  1. If a doubly linked list is I/P restricted as well as O/P restricted, the queue become

a) Linear Queue b) priority queue c) circular queue d) none of these

  1. The use of free() function in C requires the header file declaration

a) malloc.h b) calloc.h c) realloc.h d) alloc.h

  1. malloc(sizeof(int[10]))

The pointer that can point to the above defined m/y area is

a) void b) char c) int d) float

  1. The underflow condition for the circular queue is when.

a) font=rear b) front = rear+1 c) rear-front=1 d) none

  1. Minimum no of pointer adjustment for deletion of any node from the circular doubly linked list is

a) 4 b) 3 c)5 d) 2

  1. sizeof () is

a). an operator b) A keyword c) an identifier d) none of these

  1. The overflow condition in the array implementation of linked list may occur while calling to

a) freenode b) deletebeg c) getnode d) deletend

  1. Pick the odd one out

a. pqmininsert b. pqinsert c. pqmindelete d. pqmaxdelete

  1. Complexity of insertend operation with n nodes in the linear linked list is

a. O(1) b. O(n2) c. O(log2n) d. O(n)


  1. The polynomial represented by the linked list poly is

 

Coefficient

exponent

Next

0

3

4

7

Poly

1

5

7

5

Avail

2

4

3

-5

1

6

4

5

-9

5

0

6

-4

0

-1

7

8

2

3

  1. The only onde that remains in the last for the Josephus problem with count 7 is.

A

B

C

D

E

F

G

H

I

  1. Struct book

{

int acc_no;

char title[20];

float price;

};

struct book *s;

sizeof (*s) will give ………………..

  1. The complexity of deletion of the last node from a doubly linked list is

a. O(1) b. O(n) c. O(n2) d. O(nlog2n)

  1. No of nodes in the answer linked list if the two numbers given below are added (group the numbers in 4 digit each)

99999912345678912345678997812

123456789123456789123451234

a. 7 b. 8 c. 6 d. 9

18. Consider the following statement about the linked list

a. Global data structure b. linear data Structure c. traversal requires O(n) time

i. a & b are true whereas c is false

ii. all a, b & c are true

iii. b & c are true and a is false

iv. only b is true

19. What is the purpose of using header nodes in the linked?

20. Which among the following function will require the concept of previous node pointer (for linear linked list)

a. Ordered insertion b. Deletion of all occurrences of x

c. Insertion in the end d. all

  1. What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model.

22. Using C language to implement the heterogeneous linked list, what may be the different pointer types?

  1. Minimum number of queues needed to implement the priority queue is

a. 1 b. 3 c. 2 d. 0

  1. The type of the algorithm used in solving the 8 Queens problem is

a. Dynamic Programming b. Backtracking

c. Greedy method d. divide & conquer

  1. The queue data structure follows the order

a. LIFO b. Random c. FIFO d. None of these

Answers

1. REAR – FRONT +1

2. n-1

3. HEAP

4. circular queue

5. a & d both

6. a

7. a

8. d

9. a

10. c

11. b

12. d

13. 5x7 - 9x5 + 3x4 + 8x2 - 5x – 4

14. First node (content A)

15. 2

16. b

17. b

18. ii

19. i) To contain global information

ii) To avoid null condition in the case when list is empty

iii) To indicate the beginning of linked list

20. d

21.

a. RDBMS - Array (i.e. Array of structures)

b. Network data model – Graph

c. Hierarchical data model - Trees

22. The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.

23. c

24. b

25. c

 


SHARE THIS
Previous Post
Next Post