Font size
WorksheetsIT 211-DSA Midterm Exam
Total questions: 85
Worksheet time: 55mins
is a special type of queue in which each element is associated with a priority value.
(a)
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)
the elements are arranged in sequence one after the other. Since elements are arranged in particular order, they are easy to implement.
(a)
elements in memory are arranged in continuous memory.
(a)
elements are stored in the LIFO principle. That is, the last element stored in a stack will be removed first.
(a)
data structure works in the FIFO principle where first element stored in the queue will be removed first.
(a)
What type of data structures is this?
(a)
What type of data structures is this?
(a)
What type of data structures is this?
(a)
data elements are connected through a series of nodes. And, each node contains the data items and address to the next node.
(a)
Remove an element from the front of the queue.
Dequeue
Enqueue
IsEmpty
IsFull
Peek
Add an element to the end of the queue.
Dequeue
Enqueue
IsEmpty
IsFull
Peek
Check if the queue is empty.
Dequeue
Enqueue
IsEmpty
IsFull
Peek
Check if the queue is full
Dequeue
Enqueue
IsEmpty
IsFull
Peek
et the value of the front of the queue without removing it.
Dequeue
Enqueue
IsEmpty
IsFull
Peek
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.
True
False
Choose correct output for the following sequence of operations.
Push(5)
Push(8)
Pop
Push(2)
Push(5)
Pop
Pop
Pop
Push(1)
Pop
8 5 5 2 1
8 5 2 5 1
8 2 5 5 1
8 1 2 5 5
What is the use of pop operation in a stack?
Insertion
Deletion
Display
Prints the topmost element in a stack
What is the use of push operation in stack?
Insertion
Deletion
Display
Print the topmost element
What will be the value of top, if there is a size of stack STACK_SIZE is 5?
(a)
If the insertion and deletion happens from both the ends then the queue is called a______Queue
a) Deque
b) Header
c) Queue
d) Circular Queue
Process of inserting an element in stack is called ____________
Create
Push
Evaluation
Pop
Entries in a stack are “ordered”. What is the meaning of this statement?
A collection of stacks is sortable
Stack entries may be compared with the ‘<‘ operation
The entries are stored in a linked list
There is a Sequential entry that is one by one
Which of the following applications may use a stack?
a) A parentheses balancing program
b) Tracking of local variables at run time
c) Compiler Syntax Analyzer
d) Data Transfer between two asynchronous process
What is the value of the postfix expression 6 3 2 4 + – *:
1
14
74
-18
The data structure required to check whether an expression contains balanced parenthesis is?
a) Stack
b) Queue
c) Array
d) Tree
Circular Queue is also known as ________
a) Ring Buffer
b) Square Buffer
c) Rectangle Buffer
d) Curve Buffer
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) ABCD
b) DCBA
c) DCAB
d) ABDC
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) Prints all nodes of linked lists
b) Prints all nodes of linked list in reverse order
c) Prints alternate nodes of Linked List
d) Prints alternate nodes in reverse order
Linked list data structure offers considerable saving in _____________
a) Computational Time
b) Space Utilization
c) Space Utilization and Computational Time
d) Speed Utilization
What would be the solution to the given prefix notation?
2
5
7
10
Which of the following is/are the levels of implementation of data structure
Abstract level
Application level
Implementation level
All of the above
To represent hierarchical relationship between elements, Which data structure is suitable?
Dequeue
Priority
Tree
Graph
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-iii, b-ii, c-i
a-i, b-ii, c-iii
a-iii, b-i, c-ii
a-i, b-iii, c-ii
___________ is neither an algorithm nor a program.
a.Computing
b.Pseudo code
c.Computer science
d.None of the above
Efficiency of an algorithm is measured by
Time and Capacity complexity
Time and Space complexity
Speed and Space complexity
Speed and Capacity complexity
Data in the data structures are processed by operations like insertion, deletion, sorting, merging and
Traversing
Searching
Retrieval
Both A and B
To measure Time complexity of an algorithm Big O notation is used which:
A. describes limiting behaviour of the function
B. characterises a function based on growth of function
C. upper bound on growth rate of the function
D. all of the mentioned
If for an algorithm time complexity is given by O(1) then complexityof it is:
A. constant
B. polynomial
C. exponential
D. none of the mentioned
If for an algorithm time complexity is given by O(n) then complexityof it is:
A. constant
B. linear
C. exponential
D. none of the mentioned
_is a way to classify various types of data such as integer, string, etc.
Dynamic programming
Data Type
Data object
Basic Operations
which one is the example of built in data type
Deletion
List
Stack
Integers
Data types which are implementation independent as they can be implemented in one or the other way are known as_
Data Type
Data Definition
Derived Data Type
Built-in Data Type
Fibonacci sequence looks like
0,0,1,2,3,5,8,
0,0,1,2,3,5,8,13
0,1,1,1,2,3,5,8,
0,1,1,2,3,5,8,13
a linear data structure, in which the elements are not stored at contiguous memory locations.
arrays
stack
Queue
Linked list
a collection of items stored at contiguous memory locations.
index
Array
stack
queue
A programmatic way of storing data so that data can be used efficiently.
(a)
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)
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)
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)
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)
Algorithm to ______ an item in a data structure.
Search
Sort
Insert
Update
Delete
Algorithm to _____ items in a certain order.
Search
Sort
Insert
Update
Delete
Algorithm to ______ item in a data structure.
Search
Sort
Insert
Update
Delete
Algorithm to ______ an existing item in a data structure.
Search
Sort
Insert
Update
Delete
Algorithm to ______ an existing item from a data structure.
Search
Sort
Insert
Update
Delete
is a systematic way to organize data in order to use it efficiently.
Interface
Data Structure
Implementation
Correctness
It represents the set of operations that a data structure supports.
(a)
It provides the internal representation of a data structure.
(a)
A Characteristics of a Data Structure that should implement its interface correctly.
Interface
Correctness
Time Complexity
Space Complexity
A Characteristics of a Data Structure that the execution time of operations of data structure must be as small as possible.
Interface
Correctness
Time Complexity
Space Complexity
A Characteristics of a Data Structure that memory usage of a data structure operation should be as little as possible.
Interface
Correctness
Time Complexity
Space Complexity
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.
Worst Case
Average Case
Best Case
No Case
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.
Worst Case
Average Case
Best Case
No Case
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.
Worst Case
Average Case
Best Case
No Case
are values or set of values.
(a)
Refers to single unit of values.
(a)
Data items that are divided into sub items.
(a)
Data items that cannot be divided.
(a)
An entity is that which contains certain attributes or properties, which may be assigned values.
(a)
is a single elementary unit of information representing an attribute of an entity.
(a)
Each of its steps (or phases), and their inputs/outputs should be clear and must lead to only one meaning.
Unambiguous
Input
Output
Finiteness
An algorithm should have 0 or more well-defined inputs.
Unambiguous
Input
Output
Finiteness
An algorithm should have 1 or more well-defined outputs and should match the desired output.
Unambiguous
Input
Output
Finiteness
Algorithms must terminate after a finite number of steps.
Unambiguous
Input
Output
Finiteness
Algorithms must terminate after a finite number of steps.
Unambiguous
Input
Output
Finiteness
Should be feasible with the available resources.
(a)
An algorithm should have step-by-step directions, which should be independent of any programming code.
(a)
This is a theoretical analysis of an algorithm.
(a)
This is an empirical analysis of an algorithm.
(a)
An algorithm refers to defining the mathematical foundation/framing of its run-time performance.
(a)
is implemented whereas, in a priority queue, the values are removed on the basis of priority.
(a)
Priority queue can be implemented using an array, a linked list, a heap data structure, or a binary search tree.
True
False
is a type of queue in which insertion and removal of elements can either be performed from the front or the rear.
(a)
It is a data structure that consists of a collection of trees which follow min heap or max heap property.
(a)
