NEW
Font size
WorksheetsDATA STRUCTURES
Total questions: 20
Worksheet time: 10mins
Array data can be accessed using _____
A. Operator
B. Variable
C. index
D. Pointer
Which of the following is an incorrect array declaration?
A. int [] arr = new int[5]
B. int arr[] = new int[5]
C. int arr[] = new int[5]
D. int arr[] = int [5] new
Which of the following is used to declare, construct, and initialize an array?
A. int arr [] [] = {1, 2, 3, 4};
B. int [] arr = (1, 2, 3);
C. int [] arr = {};
D. int arr [] = {1, 2, 3};
In java, array elements are stored in ________ memory locations
A. Random
B. Sequential
C. Sequential & Random
D. Binary search
What will be the output of the program?
class Main
{
public static void main(String args[]) {
int arr[] = {10, 20, 30, 40, 50};
for(int i=0; i < arr.length; i++)
{
System.out.print(" " + arr[i]);
}
}
}
A. 10 20 30 40 50
B. Compiler Error
C. 10 20 30 40
D. None of the above
Minimum number of fields in each node of a doubly linked list is ____
A. 2
B. 3
C. 4
D. 5
A vertex of in-degree zero in a directed graph is called _______
A. Root vertex
B. Source vertex
C. Sink vertex
D. Articulation point
The elements of a linked list are stored
A. In a structure
B. In an array
C. Anywhere the computer has space for them
D. In contiguous memory locations
793+4/*
The evaluation of the above postfix expression is
A. 10
B. 41
C. 9
D. 21
The number of edges in a complete graph of n vertices is_______
A. n(n+1)/2
B. n(n-1)/2
C. n2 /2
D. n
The term push and pop is related to
A. Array
B. List
C. Stack
D. Queue
Which of the following is non-liner data structure?
A. Stack
B. List
C. Graph
D.Array
Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
A. Input restricted dequeue
B. Output restricted dequeue
C. Circular queue
D. Priority queue
The operation of visiting each element in the list is known as ……
A. Sorting
B. Traversing
C. Merging
D. Inserting
Which of the following is a linear data structure?
A. List
B. AVL Tree
C. Binary Tree
D. Graph
When a pop() operation is called on an empty queue, what is the condition called?
A. Overflow
B. Underflow
C. Syntax error
D. Garbage value
A graph is a collection of nodes, called ...... And line segments called arcs or ...... that connect pair of nodes.
A. vertices, paths
B. vertices, edges
C. graph node, edges
D. edges, vertices
In ........, search start at the beginning of the list and check every element in the list.
A. Binary search
B. Binary Tree search
C. Linear search
D. Exponential search
In the ....... traversal we process all of a vertex’s descendants before we move to an adjacent vertex.
A. Depth Limited
B. Breadth First
C. Width First
D. Depth First
Three standards ways of traversing a binary tree T with root R .......
A. Prefix, infix, postfix
B. Pre-process, in-process, post-process
C. Pre-traversal, in-traversal, post-traversal
D. Pre-order, in-order, post-order
