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

Question:
 A …………… is an acyclic digraph, which has only one node with indegree 0, and other nodes have in-degree 1.

1. directed tree

2.undirected tree

3.dis-joint tree

4.direction oriented tree


Question:
 A …………………… does not keep track of address of every element in the list.

1.stack

2.string

3.linear array

4.queue


Question:
 A graph is a collection of nodes, called ………. And line segments called arcs or ……….. that connect pair of nodes.

1.antinel

2.sentinel

3.ist header

4. list head


Question:
 A graph is said to be ……………… if the vertices can be split into two sets V1 and V2 such there are no edges between two vertices of V1 or two vertices of V2.

1.partite

2.bipartite

3.rooted

4.bisects


Question:
 A linear list in which each node has pointers to point to the predecessor and successors nodes is called as ..

1. singly linked list

2.circular linked list

3.doubly linked list

4.linear linked list


Question:
 Any node is the path from the root to the node is called

1. successor node

2.ancestor node

3.internal node

4.None of the above


Question:
 Arrays are best data structures …………

1.for relatively permanent collections of data

2. for the size of the structure and the data in the structure are constantly changing

3.for both of above situation

4. for none of the above


Question:
 Each array declaration need not give, implicitly or explicitly, the information about

1. the name of array

2.the data type of array

3.. the first data from the set to be stored

4. the index set of the array


Question:
 fThe disadvantage in using a circular linked list is …………………….

1.it is possible to get into infinite loop.

2.last node points to first node

3.time consuming

4.requires more memory space


Question:
 Herder node is used as sentinel in …..

1.graphs

2.stacks

3.binary tree

4.queues


Question:
 In a priority queue, insertion and deletion takes place at ………………

1.front, rear end

2.only at rear end

3.only at front end

4.any position


Question:
 In a queue, the initial values of front pointer f rare pointer r should be …….. and ……….. respectively.

1.0 and 1

2.0 and -1

3.-1 and 0

4.1 and 0


Question:
 In ……………, search start at the beginning of the list and check every element in the list.

1. linear search

2.binary search

3.hash search

4. binary tree search


Question:
 In doubly linked lists

1. a pointer is maintained to store both next and previous nodes.

2.two pointers are maintained to store next and previous nodes.

3. a pointer to self is maintained for each node.

4.none of the above


Question:
 In doubly linked lists, traversal can be performed?

1.only in forward direction

2.only in reverse direction

3. in both directions

4. none of the above


Question:
 In general, the binary search method needs no more than ……………. comparisons.

1.[log2n]-1

2.logn]+1

3. [log2n]

4.[log2n]+1


Question:
 In the …………….. traversal we process all of a vertex’s descendants before we move to an adjacent vertex.

1.depth first

2.breadth first

3.with first

4.depth limited


Question:
 Linear arrays are also called ……………….

1. straight line array

2.one-dimensional array

3.vertical array

4.horizontal array


Question:
 The simplest type of data structure is ………………

1. multidimensional array

2. linear array

3. two dimensional array

4.three dimensional array


Question:
 The time complexity of quick sort is …………..

1.o(n)

2.o(n2)

3. o(n log n)

4.o(log n)


Question:
 What is a dequeue?

1. a queue with insert/delete defined for both front and rear ends of the queue

2.a queue implemented with a doubly linked list

3.a queue implemented with both singly and doubly linked lists

4.a queue with insert/delete defined for front side of the queue


Question:
 Which data structure allows deleting data elements from front and inserting at rear?

1.stacks

2.queue

3.dequeue

4.binary search tree


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

1.array

2.tree

3.graphs

4.hierarchy


Question:
A ……. is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.

1.queue linked list

2.stacks linked list

3.both of them

4.neither of them


Question:
A ……….. is a graph that has weights of costs associated with its edges.

1. network

2.weighted graph

3. both a and b

4.none a and b


Question:
A ……………….. is a linear list in which insertions and deletions are made to from either end of the structure.

1.circular queue

2.random of queue

3.priority

4.dequeue


Question:
A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……

D. none of the above

1.. avl tree

2.red-black tree

3. lemma tree

4.None of the above


Question:
A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……

1. avl tree

2.red-black tree

3.lemma tree

4.None of the above


Question:
A circular linked list can be used for

1.stack

2.queue

3.both stack & queue

4.neither stack or queue


Question:
A data structure where elements can be added or removed at either end but not in the middle is called …

1. linked lists

2.stacks

3.queue

4.dequeue


Question:
A directed graph is ………………. if there is a path from each vertex to every other vertex in the digraph.

1. weakly connected

2.strongly connected

3.tightly connected

4.linearly connected


Question:
A list which displays the relationship of adjacency between elements is said to be

1. linear

2.non linear

3.linked list

4.trees


Question:
Arrays are best data structures …………

1. for relatively permanent collections of data.

2. for the size of the structure and the data in the structure are constantly changing

3.for both of above situation

4. for none of the above


Question:
…… is not the operation that can be performed on queue.

1.insertion

2.deletion

3.retrieval

4.traversal


Question:
…… is not the operation that can be performed on queue.

1.insertion

2.deletion

3.retrieval

4.traversal


Question:
……. Is a directed tree in which outdegree of each node is less than or equal to two.

1. unary tree

2.binary tree

3.trinary tree

4.both b and c


Question:
……. Is a pile in which items are added at one end and removed from the other.

1.stack

2.queue

3.list

4.None of the above


Question:
……… is not the operation that can be performed on queue.

1.insertion

2.deletion

3.retrieval

4.traversal


Question:
……….. level is where the model becomes compatible executable code

1.abstract level

2.application level

3.implementation level

4.All of the above


Question:
…………… is not the component of data structure.

1.operations

2.storage structures

3.algorithms

4.None of the above


Question:
Each node in a linked list has two pairs of ………….. and ……………….

1.link field and information field

2. link field and avail field

3.avail field and information field

4.address field and link field


Question:
Finding the location of the element with a given value is:

1.traversal

2.search

3.sort

4.None of the above


Question:
How do you count the number of elements in the circular linked list?

1.public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != head){temp = temp.getnext();length++;}return length;}

2. public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != null){temp = temp.getnext();length++;}return length;}

3. public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != head && temp != null){temp = head.getnext();length++;}return length;}

4.public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != head && temp == null){temp = head.getnext();length++;}return length;}


Question:
Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

1.input restricted dequeue

2.output restricted qequeue

3.output restricted qequeue

4.stack


Question:
In a circular queue the value of r will be ..

1.r=r+1

2.r=(r+1)% [queue_size – 1]

3.r=(r+1)% queue_size

4.r=(r-1)% queue_size


Question:
Inserting an item into the stack when stack is not full is called …………. Operation and deletion of item form the stack, when stack is not empty is called ………..operation.

1.push, pop

2. pop, push

3.insert, delete

4.delete, insert


Question:
node.next -> node.next.next; will make

1.node.next inaccessible

2.node.next.next inaccessible

3.this node inaccessible

4.None of the above


Question:
Stack is also called as

1.last in first out

2.first in last out

3.last in last out

4.first in first out


Question:
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are

1.full: (rear+1) mod n == front, empty: rear == front

2. full: (rear+1) mod n == front, empty: (front+1) mod n == rear

3. full: rear == front, empty: (rear+1) mod n == front

4.full: (front+1) mod n == rear, empty: rear == front


Question:
The advantage of …………….. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists.

1.lists

2.linked lists

3.trees

4.queues


Question:
The data structure which is one ended is ………………

1. queue

2.stack

3.tree

4.graph


Question:
The disadvantage in using a circular linked list is …………………….

1. A. it is possible to get into infinite loop

2.last node points to first node

3. time consuming

4.requires more memory space


Question:
The logical or mathematical model of a particular organization of data is called a ………

1.data structure

2.data arrangement

3.data configuration

4.data formation


Question:
The number of comparisons done by sequential search is ………………

1.(n/2)+1

2.(n+1)/2

3.(n-1)/2

4.(n+2)/2


Question:
The property of binary tree is

1.the first subset is called left subtree

2. the second subtree is called right subtree

3. the root cannot contain null

4.the right subtree can be empty


Question:
The term "push" and "pop" is related to the

1. array

2.lists

3.stacks

4.all of the above


Question:
There is an extra element at the head of the list called a ……….

1.antinel

2.sentinel

3.list header

4.list head


Question:
To represent hierarchical relationship between elements, Which data structure is suitable?

1.dequeue

2.priority

3.tree

4.graph


Question:
What differentiates a circular linked list from a normal linked list?

1.you cannot have the ‘next’ pointer point to null in a circular linked list

2. it is faster to traverse the circular linked list

3. you may or may not have the ‘next’ pointer point to null in a circular linked list

4.head node is known in circular linked list


Question:
What will be the value of top, if there is a size of stack STACK_SIZE is 5

1.5

2.6

3.4

4.None of the above


Question:
When does top value of the stack changes?

1.before deletion

2.while checking underflow

3. at the time of deletion

4. after deletion


Question:
Which data structure allows deleting data elements from and inserting at rear?

1. stacks

2.queues

3.dequeues

4.binary search tree


Question:
Which data structure is used in breadth first search of a graph to hold nodes?

1.stack

2.queue

3.tree

4.array


Question:
Which data structure is used in breadth first search of a graph to hold nodes?

1.stack

2.queue

3.tree

4.array


Question:
Which if the following is/are the levels of implementation of data structure

1.abstract level

2.application level

3.implementation level

4. all of the above


Question:
Which is/are the application(s) of stack

1.function calls

2.large number arithmetic

3. evaluation of arithmetic expressions

4.All of the above


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

1.graph

2.trees

3.binary tree

4.stack


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

1. strings

2.lists

3.stacks

4.graph


Question:
Which of the following data structure is non-linear type?

1.strings

2.lists

3.stacks

4.tree


Question:
Which of the following data structures are indexed structures?

1. linear arrays

2.linked lists

3.graphs

4.trees


Question:
Which of the following is an application of stack?

1. finding factorial

2.tower of hanoi

3.infix to postfix conversion

4. all of the above


Question:
Which of the following is non-liner data structure?

1.stacks

2.list

3.strings

4.trees


Question:
Which of the following is not the internal sort?

1.insertion sort

2.bubble sort

3.merge sort

4.heap sort


Question:
Which of the following is not the part of ADT description?

1. data

2.operations

3.both of the above

4.None of the above


Question:
Which of the following statement is true?i) Using singly linked lists and circular list, it is not possible to traverse the list backwards.ii) To find the predecessor, it is required to traverse the list from the first node in case of singly linked list.

1. i-only

2. ii-only

3.both i and ii

4.None of the above


More MCQS

  1. Data Structures and algorithms MCQ Questions
  2. Data Structure -Abstract Data Types
  3. Data Structure Questions and Answers Singly Linked
  4. Data Structures &algorithms MCQ Questions
  5. Data Structure Multiple Choice Questions and Answers
  6. Data Structure (DS) MCQ Set 1
  7. Data Structure (DS) MCQ Set 2
  8. Data Structure and Algorithms (DSA) set 1
  9. Data Structure and Algorithms (DSA) set 2
  10. Data Structure and Algorithms (DSA) set 3
  11. Data Structure and Algorithms (DSA) set 4
  12. Data Structure and Algorithms (DSA) set 5
  13. Linear Data Structures - List
  14. Data Structure MCQ questions and answer
  15. Data Structure MCQ questions and answer
Search
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!