wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

data structures1

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

If the insertion and deletion happens from both the ends then the queue is called a______Queue

a)

a) Deque

b)

b) Header

c)

c) Queue

d)

d) Circular Queue

2.

Process of inserting an element in stack is called ____________

a)

Create

b)

Push

c)

Evaluation

d)

Pop

3.

Entries in a stack are “ordered”. What is the meaning of this statement?

a)

A collection of stacks is sortable

b)

Stack entries may be compared with the ‘<‘ operation

c)

The entries are stored in a linked list

d)

There is a Sequential entry that is one by one

4.

What is the value of the postfix expression 6 3 2 4 + – *:

a)

1

b)

14

c)

74

d)

-18

5.

The data structure required to check whether an expression contains balanced parenthesis is?

a)

a) Stack

b)

b) Queue

c)

c) Array

d)

d) Tree

6.

Circular Queue is also known as ________

a)

a) Ring Buffer

b)

b) Square Buffer

c)

c) Rectangle Buffer

d)

d) Curve Buffer

7.

If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?

a)

a) ABCD

b)

b) DCBA

c)

c) DCAB

d)

d) ABDC

8.

What does the following function do for a given Linked List with first node as head?

void fun1(struct node* head)

{

if(head == NULL)

return;

fun1(head->next);

printf("%d ", head->data);

}

a)

a) Prints all nodes of linked lists

b)

b) Prints all nodes of linked list in reverse order

c)

c) Prints alternate nodes of Linked List

d)

d) Prints alternate nodes in reverse order

9.

Linked list data structure offers considerable saving in _____________

a)

a) Computational Time

b)

b) Space Utilization

c)

c) Space Utilization and Computational Time

d)

d) Speed Utilization

10.

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

a)

Dequeue

b)

Priority

c)

Tree

d)

Graph

11.

Match the following.


a) Completeness i) How long does it take to find a solution

b) Time Complexity ii) How much memory need to perform the search.

c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.

a)

a-iii, b-ii, c-i

b)

a-i, b-ii, c-iii

c)

a-iii, b-i, c-ii

d)

a-i, b-iii, c-ii

12.

___________ is neither an algorithm nor a program.

a)

a.Computing

b)

b.Pseudo code

c)

c.Computer science

d)

d.None of the above

13.

Efficiency of an algorithm is measured by

a)

Time and Capacity complexity

b)

Time and Space complexity

c)

Speed and Space complexity

d)

Speed and Capacity complexity

14.

Data in the data structures are processed by operations like insertion, deletion, sorting, merging and

a)

Traversing

b)

Searching

c)

Retrieval

d)

Both A and B

15.

To measure Time complexity of an algorithm Big O notation is used which:

a)

A. describes limiting behaviour of the function

b)

B. characterises a function based on growth of function

c)

C. upper bound on growth rate of the function

d)

D. all of the mentioned

16.

If for an algorithm time complexity is given by O(1) then complexityof it is:

a)

A. constant

b)

B. polynomial

c)

C. exponential

d)

D. none of the mentioned

17.

If for an algorithm time complexity is given by O(n) then complexityof it is:

a)

A. constant

b)

B. linear

c)

C. exponential

d)

D. none of the mentioned

18.

Can We Implement Stack Using Queue Data structure

a)

Yes

b)

No

19.

Can We implement Queue data structure using stack data structure

a)

Yes

b)

No

20.

In a stack, if a user tries to remove an element from empty stack it is called _________

a)

Underflow

b)

Stack is Empty

c)

Overflow

d)

None of the above