wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

elanif

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.
You want to update kth element of array "a" to 5. Which is correct syntax ?
a)
a[k]=5;
b)
a[k+1]=5;
c)
a[5]=k;
d)
a[k-1]=5;
2.
You have implemented stack using array a. Which is correct to check the stack is empty?
a)
a[top]==-1;
b)
a[0]==-1
c)
top==-1
d)
top==0
3.
You have implemented stack using array a where capacity of the stack is difened as MAX. Which is correct to check the stack is FULL?
a)
a[top]==MAX
b)
a[top]==MAX-1
c)
top==MAX
d)
top==MAX-1
4.
You have implemented stack using singly linked list where head of the list is stored at *R. Which condition is to be satisfied to check the stack is full or not?
a)
R==NULL
b)
R==TOP
c)
stack can not be full
d)
None of these
5.
You have implemented stack using singly linked list where head of the list is stored at *R. Which condition is to be satisfied to check the stack is empty or not?
a)
R==NULL
b)
R==TOP
c)
stack can not be empty
d)
None of these
6.
Which is NOT an application of stack?
a)
infix to postfix
b)
reversing the list
c)
paranthesis checking of a string
d)
process the object in first in first out
7.
A shared printer want to store documents in its own memory. Which data structure to be maintained in the printer software?
a)
stack
b)
queue
c)
tree
d)
graph
8.
Number of nodes in level K of a complete binary tree is ____
a)
2^K
b)
2^(K+1)
c)
2^(K-1)
d)
Log K
9.
A complete binary tree has hight K. How many minimum number of nodes are there ?
a)
2^K
b)
2^(K+1)
c)
2^(K-1)
d)
Log K
10.
A un weighted undirected graph is implemented using adjacency matrix. How to find the node with highest degree?
a)
the column has highest zeros
b)
the column has highest number of 1's
c)
either the column or the row will have highest number of 1's
d)
both row and column will have highest 1's
11.
An undirected graph is represented using matrix A. In the matrix A[m][n] is assigned as -1. That means _____.
a)
there is no path between m and n.
b)
there is no direct edge between m and n
c)
there exist multiple edges between m and n
12.
Binary search can be implemented iff _____.
a)
the array is sorted in ascending order
b)
the array is sorted in descending order
c)
the array is sorted either ascending or descending order
d)
the array may or may not the sorted.
13.
A BST has 31 nodes. What would be the minimum hight to arrage it?
a)
4
b)
5
c)
6
d)
7
14.
A BST has the hight 7. How many minimum and maximum nodes can be occupied?
a)
8 and 254
b)
8 and 255
c)
7 and 255
d)
8 and 256
15.
In a single linked list, you want to catch the 14th node, How many times, the head pointer has to traverse?
a)
13
b)
14
c)
15
d)
16
16.
In an array of size 20, you want to insert an element at index 6 (index starts from 0). How many shifting operations required?
a)
13
b)
14
c)
15
d)
16
17.
In a graph of 6 vertices how many edges possible? If there is no edges possible between itself.
a)
20
b)
10
c)
15
d)
25