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

1.nodes

2.arrays

3.entities

4.instances

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

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

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

1. hollow

2.empty

3.finite

4.infinite

1.the data

3.both a & b

4.none of these

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

1.static

2.dynamic

3.compile time

4.None of these

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

1. lifo

2.fifo

3. both a & b

4.None of these

1.ab+cdâ€“*

2.abc+*â€“

3.ab+*cd

4. ab+*cdâ€“

1.front

2.rear

3.both a & b

4.None of These

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

1.fifo lists

2.lifo list

3.piles

4.push-down lists

1. o(n)

2.o(log(n))

3.o(1)

4.n/a

1. o(n)

2.o(1)

3.o(log(n))

4.n/a

1.null

2.next node

3.new node

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

1.previous node

2.next node

3.current node

4.both a & b

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

1.q[0]

2.q[1]

3.q[9]

4. q[10]

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

1.4

2.3

3.2

4.1

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

1.tail

3.terminator

4.initiator

1. 1036

2.1028

3.1038

4.None of these

1. null

2.garbage

3.1

4.2

1.3

2.4

3.1

4.2

1.push

2.pop

3.peek

4.None of These

1. push

2.pop

3.display

4.peek

1.array

3.tree

4.None of These

## Question: `Linked list uses`

1.random memory allocation

2.static memory allocation

3.fixed memory allocation

4. dynamic memory allocation

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

1.lifo

2.fifo

3.both a & b

4.None of These

1.1 type

2.2 type

3.3 type

4.4 type

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

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

1.queue

2.stacks

3.array

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

1.overflow

2.top

3.queues

4.underflow

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

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

1.a pile of books

2.bus stop

4.a carat of eggs

1.abcde\$*/-

2. a-bcde\$*/-

3. abc\$ed*/-

4.a-bcde\$*/

1. -1

2.0

3.2

4.x

1.decrement

2.increment

3.one

4.none of these

1.strings

2.stack

3.queue

4.all of these

1.push

2.pop

3.display

4.enqueue

1.push

2.pop

3.display

4.enqueue

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

1.o(log(n))

2.o(1)

3.n/a

4.o(n)

## More MCQS

##### Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite 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!