# 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))

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;

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

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

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
{"ft_lang_label":"__label__en","ft_lang_prob":0.6833678,"math_prob":0.9586914,"size":3849,"snap":"2019-51-2020-05","text_gpt3_token_len":1152,"char_repetition_ratio":0.12145644,"word_repetition_ratio":0.018372703,"special_character_ratio":0.31021044,"punctuation_ratio":0.12397661,"nsfw_num_words":1,"has_unicode_error":false,"math_prob_llama3":0.98069984,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-19T20:56:32Z\",\"WARC-Record-ID\":\"<urn:uuid:1150d201-988d-455e-9253-885116c9de38>\",\"Content-Length\":\"188333\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dd277bbd-a881-4f5f-8cb6-60c131b77bb2>\",\"WARC-Concurrent-To\":\"<urn:uuid:ab54ba9a-c69c-4dcb-9ab3-1943eb7e07cd>\",\"WARC-IP-Address\":\"172.217.13.243\",\"WARC-Target-URI\":\"http://www.tutioncentral.com/2012/04/data-structure-quiz-2-solved.html\",\"WARC-Payload-Digest\":\"sha1:R4MGCBCFBDEYUAJJ7BVT4GHZWZZRVVYI\",\"WARC-Block-Digest\":\"sha1:CXIMFTMWM5S4YXSEIXBDWCQQ763FGPEU\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250595282.35_warc_CC-MAIN-20200119205448-20200119233448-00511.warc.gz\"}"}