# Data structure/Data Structure (DS) MCQ Set 2 Sample Test,Sample questions

## Question: ` A linked list is made up of a set of objects known as`

1.nodes

2.arrays

3.entities

4.instances

Posted Date:-2022-07-05 11:54:14

## Question: ` Data Structure that are created by user as per their requirement are known as`

1.primitive data structure

2.non-primitive data structure

3.both a & b

4.None of these

Posted Date:-2022-07-05 12:28:56

## Question: ` How do you calculate the pointer difference in a memory efficient double linked list?`

2.pointer to previous node xor pointer to next node

3. pointer to previous node â€“ pointer to next node

4.pointer to next node â€“ pointer to previous node

Posted Date:-2022-07-05 11:55:20

## Question: ` How do you calculate the pointer difference in a memory efficient double linked list?`

2.pointer to previous node xor pointer to next node

3. pointer to previous node â€“ pointer to next node

4.pointer to next node â€“ pointer to previous node

Posted Date:-2022-07-05 11:55:21

## Question: ` If a list contains no elements it is said to be`

1. hollow

2.empty

3.finite

4.infinite

Posted Date:-2022-07-05 11:48:45

## Question: ` In linked list implementation, a node carries information regarding`

1.the data

3.both a & b

4.none of these

Posted Date:-2022-07-05 12:30:49

## Question: ` In stack terminology, the __________operations are known as push and pop operations respectively.`

1.delete

2.insert

3.both (a) and (b)

4.None of the above

Posted Date:-2022-07-05 12:08:21

## Question: ` Linked list is generally considered as an example of _________ type of memory allocation.`

1.static

2.dynamic

3.compile time

4.None of these

Posted Date:-2022-07-05 11:45:41

## Question: ``` public int function() { if(head == null) return Integer.MIN_VALUE; int var; Node temp = head; while(temp.getNext() != head) temp = temp.getNext(); if(temp == head) { var = head.getItem(); head = null; return var; } temp.setNext(head.getNext()); var = head.getItem(); head = head.getNext(); return var; } What is the functionality of the following code? Choose the most appropriate answer.```

1.return data from the end of the list

2.returns the data and deletes the node at the end of the list

3.returns the data from the beginning of the list

4.returns the data and deletes the node from the beginning of the list

Posted Date:-2022-07-05 13:06:12

## Question: ` Stack is ____ type of data structure.`

1. lifo

2.fifo

3. both a & b

4.None of these

Posted Date:-2022-07-05 12:38:36

## Question: ` What is the postfix form of the following prefix:*+abâ€“cd`

1.ab+cdâ€“*

2.abc+*â€“

3.ab+*cd

4. ab+*cdâ€“

Posted Date:-2022-07-05 12:06:19

## Question: ` When we insert an element in Queue, which pointer is increased by one?`

1.front

2.rear

3.both a & b

4.None of These

Posted Date:-2022-07-05 12:49:21

## Question: ` Which of the following name does not relate to stacks?`

1.fifo lists

2.lifo list

3.piles

4.push-down lists

Posted Date:-2022-07-05 12:02:17

## Question: ` Worst space complexity of queue data structure is`

1. o(n)

2.o(log(n))

3.o(1)

4.n/a

Posted Date:-2022-07-05 12:53:16

## Question: ` Worst space complexity of singly linked list is`

1. o(n)

2.o(1)

3.o(log(n))

4.n/a

Posted Date:-2022-07-05 12:55:38

## Question: `. To insert element at start, the previous pointer of newly added node would point to ______`

1.null

2.next node

3.new node

Posted Date:-2022-07-05 12:29:40

## Question: `A common example of a queue is people waiting in line at a__________.`

1. A. bus stop

2.movie hall

3.shopping mall

4.None of the above

Posted Date:-2022-07-05 12:09:17

## Question: `A double linked list contains reference to _____`

1.previous node

2.next node

3.current node

4.both a & b

Posted Date:-2022-07-05 12:27:56

## Question: `A queue is a,`

1.fifo (first in first out) list

2. lifo (last in first out) list

3. ordered array

4.linear tree

Posted Date:-2022-07-05 12:07:17

## Question: `Consider a standard Circular Queue 'q' implementation (which has the same condition for Queue Full and Queue Empty) whose size is 11 and the elements of the queue are q[0], q[1], q[2].....,q[10]. The front and rear pointers are initialized to point at q[2] . In which position will the ninth element be added?`

1.q[0]

2.q[1]

3.q[9]

4. q[10]

Posted Date:-2022-07-05 11:42:41

## Question: ```Consider the following statements:i. First-in-first out types of computations are efficiently supported by STACKS. ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations. iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two indices. iv. Last-in-first-out type of computations are efficiently supported by QUEUES.Which of the following is correct?```

1.(ii) and (iii) are true

2. (i) and (ii) are true

3. (iii) and (iv) are true

4.(ii) and (iv) are true

Posted Date:-2022-07-05 11:39:16

## Question: `Data structre is divided into _____ parts.`

1.4

2.3

3.2

4.1

Posted Date:-2022-07-05 12:45:13

## Question: `Each Node contain minimum two fields one field called data field to store data. Another field is of type ____`

1.pointer to class

2.pointer to an integer

3.pointer to character

4.pointer to node

Posted Date:-2022-07-05 11:46:33

## Question: `First link node of list is accessed from a pointer named`

1.tail

3.terminator

4.initiator

Posted Date:-2022-07-05 11:53:35

## Question: `If in a linked list address of first node is 1020 then what will be the address of node at 5th position ?`

1. 1036

2.1028

3.1038

4.None of these

Posted Date:-2022-07-05 11:47:12

## Question: `if there are no nodes in linked list then start pointer will point at which value?`

1. null

2.garbage

3.1

4.2

Posted Date:-2022-07-05 12:52:37

## Question: `In Circular Linked List insertion of a node involves the modification of ____ links.`

1.3

2.4

3.1

4.2

Posted Date:-2022-07-05 11:47:48

## Question: `In stack deletion operation is referred as _____`

1.push

2.pop

3.peek

4.None of These

Posted Date:-2022-07-05 12:43:50

## Question: `In stack, to display the lastly inserted element without removing it, which function is used?`

1. push

2.pop

3.display

4.peek

Posted Date:-2022-07-05 12:51:43

## Question: `In ___ Data Structure data can be processed one by one sequentially`

1.array

3.tree

4.None of These

Posted Date:-2022-07-05 12:48:18

## Question: `Linked list uses`

1.random memory allocation

2.static memory allocation

3.fixed memory allocation

4. dynamic memory allocation

Posted Date:-2022-07-05 11:49:41

## Question: `Overflow condition in linked list may occur when attempting to .............`

1. create a node when free space pool is empty

2.traverse the nodes when free space pool is empty

3.create a node when linked list is empty

4.None of These

Posted Date:-2022-07-05 11:43:50

## Question: `Queue is _____ type of data structure.`

1.lifo

2.fifo

3.both a & b

4.None of These

Posted Date:-2022-07-05 12:44:32

## Question: `Standard approach for implementation of a list is/are of`

1.1 type

2.2 type

3.3 type

4.4 type

Posted Date:-2022-07-05 11:52:41

## Question: `Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?`

1.a queue cannot be implemented using this stack.

2.a queue can be implemented where enqueue takes a single instruction and dequeue takes a sequence of two instructions.

3.a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction.

4.a queue can be implemented where both enqueue and dequeue take a single instruction each.

Posted Date:-2022-07-05 11:37:17

## Question: ```Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are: i. isEmpty (Q) â€” returns true if the queue is empty, false otherwise. ii. delete (Q) â€” deletes the element at the front of the queue and returns its value. iii. insert (Q, i) â€” inserts the integer i at the rear of the queue. Consider the following function: void f (queue Q) { int i ; if (!isEmpty(Q)) { i = delete(Q); f(Q); insert(Q, i); } }What operation is performed by the above function f ?```

1.leaves the queue q unchanged

2.reverses the order of the elements in the queue q

3.deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order

4.empties the queue q

Posted Date:-2022-07-05 11:38:24

## Question: `The data structure required to evaluate a postfix expression is`

1.queue

2.stacks

3.array

Posted Date:-2022-07-05 12:05:18

## Question: `The postfix form of the expression (A + B)âˆ—(Câˆ—D âˆ’ E)âˆ—F / G is`

1.ab + cdâˆ—e âˆ’ fg /âˆ—âˆ—

2./ ab + cd âˆ— e âˆ’ f âˆ—âˆ—g /

3.ab + cd âˆ— e âˆ’ âˆ—f âˆ— g /

4.ab + cde âˆ— âˆ’ âˆ— f âˆ— g /

Posted Date:-2022-07-05 12:03:32

## Question: `The total number of elements in a stack at a given point of time can be calculated from the value of______.`

1.overflow

2.top

3.queues

4.underflow

Posted Date:-2022-07-05 12:26:15

## Question: `What happens when the stack is full and there is no space for a new element, and an attempt is made to push a new element?`

1. overflow

2.underflow

3.top

4. none of the above

Posted Date:-2022-07-05 12:25:31

## Question: `What is one of the common examples of a stack?`

1.a pile of books

2.bus stop

4.a carat of eggs

Posted Date:-2022-07-05 12:11:16

## Question: `What is the postfix form of the following prefix expression -A/B*C\$DE ?`

1.abcde\$*/-

2. a-bcde\$*/-

3. abc\$ed*/-

4.a-bcde\$*/

Posted Date:-2022-07-05 12:04:31

## Question: `When a stack is organized as an array, a variable named Top is used to point to the top element of the stack. Initially, the value of Top is set to_______to indicate an empty stack.`

1. -1

2.0

3.2

4.x

Posted Date:-2022-07-05 12:12:08

## Question: `When the push operation is performed on stack the value of TOS will be ______`

1.decrement

2.increment

3.one

4.none of these

Posted Date:-2022-07-05 12:27:04

## Question: `Which of the following data structure is linear type?`

1.strings

2.stack

3.queue

4.all of these

Posted Date:-2022-07-05 12:37:29

## Question: `Which of the following is a possible operation on queue?`

1.push

2.pop

3.display

4.enqueue

Posted Date:-2022-07-05 12:51:01

## Question: `Which of the following is not a type of Linked List ?`

Posted Date:-2022-07-05 11:44:56

## Question: `Which of the following is not the possible operation on stack?`

1.push

2.pop

3.display

4.enqueue

Posted Date:-2022-07-05 12:49:58

## Question: `Which of the following option is not correct?`

1.if the queue is implemented with a linked list, keeping track of a front pointer, only rear pointer s will change during an insertion into an non-empty queue.

2. queue data structure can be used to implement least recently used (lru) page fault algorithm and quick short algorithm.

3. queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault algorithm.

4.. both (a) and (c)

Posted Date:-2022-07-05 11:41:52

## Question: `Worst space complexity of stack data structure is`

1.o(log(n))

2.o(1)

3.n/a

4.o(n)

Posted Date:-2022-07-05 12:54:11

## More MCQS

##### R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!