wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IT 211-DSA Midterm Exam

Total questions: 85

Worksheet time: 55mins

Name
Class
Date
1.

is a special type of queue in which each element is associated with a priority value.

(a)  

2.

is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

(a)  

3.

the elements are arranged in sequence one after the other. Since elements are arranged in particular order, they are easy to implement.

(a)  

4.

elements in memory are arranged in continuous memory.

(a)  

5.

elements are stored in the LIFO principle. That is, the last element stored in a stack will be removed first.

(a)  

6.

data structure works in the FIFO principle where first element stored in the queue will be removed first.



(a)  

7.

What type of data structures is this?

(a)  

8.

What type of data structures is this?

(a)  

9.

What type of data structures is this?

(a)  

10.

data elements are connected through a series of nodes. And, each node contains the data items and address to the next node.

(a)  

11.
  • Remove an element from the front of the queue.

a)
  • Dequeue

b)
  • Enqueue

c)
  • IsEmpty

d)
  • IsFull

e)
  • Peek

12.
  • Add an element to the end of the queue.

a)
  • Dequeue

b)
  • Enqueue

c)
  • IsEmpty

d)
  • IsFull

e)
  • Peek

13.
  • Check if the queue is empty.

a)
  • Dequeue

b)
  • Enqueue

c)
  • IsEmpty

d)
  • IsFull

e)
  • Peek

14.
  • Check if the queue is full

a)
  • Dequeue

b)
  • Enqueue

c)
  • IsEmpty

d)
  • IsFull

e)
  • Peek

15.
  • et the value of the front of the queue without removing it.

a)
  • Dequeue

b)
  • Enqueue

c)
  • IsEmpty

d)
  • IsFull

e)
  • Peek

16.

The complexity of enqueue and dequeue operations is not queue using an array is O(1). If you use pop(N) in python code, then the complexity might be O(n) depending on the position of the item to be popped.


a)

True

b)

False

17.

Choose correct output for the following sequence of operations.

Push(5)

Push(8)

Pop

Push(2)

Push(5)

Pop

Pop

Pop

Push(1)

Pop

a)

8 5 5 2 1

b)

8 5 2 5 1

c)

8 2 5 5 1

d)

8 1 2 5 5

18.

What is the use of pop operation in a stack?

a)

Insertion

b)

Deletion

c)

Display

d)

Prints the topmost element in a stack

19.

What is the use of push operation in stack?

a)

Insertion

b)

Deletion

c)

Display

d)

Print the topmost element

20.

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

(a)  

21.

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

22.

Process of inserting an element in stack is called ____________

a)

Create

b)

Push

c)

Evaluation

d)

Pop

23.

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

24.

Which of the following applications may use a stack?

a)

a) A parentheses balancing program

b)

b) Tracking of local variables at run time

c)

c) Compiler Syntax Analyzer

d)

d) Data Transfer between two asynchronous process

25.

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

a)

1

b)

14

c)

74

d)

-18

26.

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

27.

Circular Queue is also known as ________

a)

a) Ring Buffer

b)

b) Square Buffer

c)

c) Rectangle Buffer

d)

d) Curve Buffer

28.

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

29.

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

30.

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

31.

What would be the solution to the given prefix notation?

a)

2

b)

5

c)

7

d)

10

32.

Which of the following is/are the levels of implementation of data structure

a)

Abstract level

b)

Application level

c)

Implementation level

d)

All of the above

33.

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

a)

Dequeue

b)

Priority

c)

Tree

d)

Graph

34.

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

35.

___________ is neither an algorithm nor a program.

a)

a.Computing

b)

b.Pseudo code

c)

c.Computer science

d)

d.None of the above

36.

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

37.

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

38.

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

39.

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

40.

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

41.

_is a way to classify various types of data such as integer, string, etc.

a)

Dynamic programming

b)

Data Type

c)

Data object

d)

Basic Operations

42.

which one is the example of built in data type

a)

Deletion

b)

List

c)

Stack

d)

Integers

43.

Data types which are implementation independent as they can be implemented in one or the other way are known as_

a)

Data Type

b)

Data Definition

c)

Derived Data Type

d)

Built-in Data Type

44.

 Fibonacci sequence looks like

a)

0,0,1,2,3,5,8,

b)

0,0,1,2,3,5,8,13

c)

0,1,1,1,2,3,5,8,

d)

0,1,1,2,3,5,8,13

45.

a linear data structure, in which the elements are not stored at contiguous memory locations.

a)

arrays

b)

stack

c)

Queue

d)

Linked list

46.

a collection of items stored at contiguous memory locations.

a)

index

b)

Array

c)

stack

d)

queue

47.

A programmatic way of storing data so that data can be used efficiently.

(a)  

48.

As applications are getting complex and data rich, there are three common problems that applications face now-a-days. Consider an inventory of 1 million(106) items of a store.

(a)  

49.

As applications are getting complex and data rich, there are three common problems that applications face now-a-days. Processor speed although being very high, falls limited if the data grows to billion records.

(a)  

50.

As applications are getting complex and data rich, there are three common problems that applications face now-a-days. As thousands of users can search data simultaneously on a web server, even the fast server fails while searching the data.

(a)  

51.

is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output.

(a)  

52.

Algorithm to ______ an item in a data structure.

a)

Search

b)

Sort

c)

Insert

d)

Update

e)

Delete

53.

Algorithm to _____ items in a certain order.

a)

Search

b)

Sort

c)

Insert

d)

Update

e)

Delete

54.

Algorithm to ______ item in a data structure.

a)

Search

b)

Sort

c)

Insert

d)

Update

e)

Delete

55.

Algorithm to ______ an existing item in a data structure.

a)

Search

b)

Sort

c)

Insert

d)

Update

e)

Delete

56.

Algorithm to ______ an existing item from a data structure.

a)

Search

b)

Sort

c)

Insert

d)

Update

e)

Delete

57.

is a systematic way to organize data in order to use it efficiently.

a)

Interface

b)

Data Structure

c)

Implementation

d)

Correctness

58.

It represents the set of operations that a data structure supports.

(a)  

59.

It provides the internal representation of a data structure.

(a)  

60.

A Characteristics of a Data Structure that should implement its interface correctly.

a)

Interface

b)

Correctness

c)

Time Complexity

d)

Space Complexity

61.

A Characteristics of a Data Structure that the execution time of operations of data structure must be as small as possible.

a)

Interface

b)

Correctness

c)

Time Complexity

d)

Space Complexity

62.

A Characteristics of a Data Structure that memory usage of a data structure operation should be as little as possible.

a)

Interface

b)

Correctness

c)

Time Complexity

d)

Space Complexity

63.

A case which are usually used to compare various data structure's execution time in a relative manner. Where a particular data structure operation takes maximum time it can take.

a)

Worst Case

b)

Average Case

c)

Best Case

d)

No Case

64.

A case which are usually used to compare various data structure's execution time in a relative manner. If an operation takes ƒ(n) time in execution, then m operations will take mƒ(n) time.

a)

Worst Case

b)

Average Case

c)

Best Case

d)

No Case

65.

A case which are usually used to compare various data structure's execution time in a relative manner. Depicting the least possible execution time of an operation of a data structure.

a)

Worst Case

b)

Average Case

c)

Best Case

d)

No Case

66.

are values or set of values.

(a)  

67.

Refers to single unit of values.

(a)  

68.

Data items that are divided into sub items.

(a)  

69.

Data items that cannot be divided.

(a)  

70.

An entity is that which contains certain attributes or properties, which may be assigned values.

(a)  

71.

is a single elementary unit of information representing an attribute of an entity.

(a)  

72.

Each of its steps (or phases), and their inputs/outputs should be clear and must lead to only one meaning.

a)

Unambiguous

b)

Input

c)

Output

d)

Finiteness

73.

An algorithm should have 0 or more well-defined inputs.

a)

Unambiguous

b)

Input

c)

Output

d)

Finiteness

74.

An algorithm should have 1 or more well-defined outputs and should match the desired output.

a)

Unambiguous

b)

Input

c)

Output

d)

Finiteness

75.

Algorithms must terminate after a finite number of steps.

a)

Unambiguous

b)

Input

c)

Output

d)

Finiteness

76.

Algorithms must terminate after a finite number of steps.

a)

Unambiguous

b)

Input

c)

Output

d)

Finiteness

77.

Should be feasible with the available resources.

(a)  

78.

An algorithm should have step-by-step directions, which should be independent of any programming code.

(a)  

79.

This is a theoretical analysis of an algorithm.

(a)  

80.

This is an empirical analysis of an algorithm.

(a)  

81.

An algorithm refers to defining the mathematical foundation/framing of its run-time performance.

(a)  

82.

is implemented whereas, in a priority queue, the values are removed on the basis of priority.

(a)  

83.

Priority queue can be implemented using an array, a linked list, a heap data structure, or a binary search tree.

a)

True

b)

False

84.

is a type of queue in which insertion and removal of elements can either be performed from the front or the rear.

(a)  

85.

It is a data structure that consists of a collection of trees which follow min heap or max heap property.

(a)