0% found this document useful (0 votes)
38 views7 pages

DS 2 Marks Model QB

1. A linked list is a linear data structure where elements are not stored at contiguous memory locations. An Abstract Data Type (ADT) defines operations but not implementation. Algorithm analysis is important for system performance and time-sensitive applications. 2. Data structures provide efficient ways to store and organize data. Examples include arrays, linked lists, stacks, and queues. Doubly linked lists allow bidirectional traversal. Circular linked lists can implement stacks and queues. 3. Stacks support push, pop, top, isEmpty and size operations. Postfix expressions do not require parentheses because operator order determines evaluation order. Priority queues serve elements based on priority and can be implemented with arrays, linked lists or heaps.

Uploaded by

Prathiksha S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views7 pages

DS 2 Marks Model QB

1. A linked list is a linear data structure where elements are not stored at contiguous memory locations. An Abstract Data Type (ADT) defines operations but not implementation. Algorithm analysis is important for system performance and time-sensitive applications. 2. Data structures provide efficient ways to store and organize data. Examples include arrays, linked lists, stacks, and queues. Doubly linked lists allow bidirectional traversal. Circular linked lists can implement stacks and queues. 3. Stacks support push, pop, top, isEmpty and size operations. Postfix expressions do not require parentheses because operator order determines evaluation order. Priority queues serve elements based on priority and can be implemented with arrays, linked lists or heaps.

Uploaded by

Prathiksha S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

R.M.K.

ENGINEERING COLLEGE
RSM Nagar, Kavaraipettai – 601 206

Question Bank for the Units – I to V 2MARKS

Part-A (10 x 2 = 20 Marks) K CO Stand


Level ard
S/A

1. Define Linked List.


A linked list is a linear data structure, in which the elements are not stored at K1 CO1 A
contiguous memory locations.

2. What is Abstract Data Type (ADT)?


Abstract Data type (ADT) is a type (or class) for objects whose
behavior is defined by a set of values and a set of operations.
The definition of ADT only mentions what operations are to be
performed but not how these operations will be implemented. It K1 CO1 A
does not specify how data will be organized in memory and
what algorithms will be used for implementing the operations. It
is called “abstract” because it gives an implementation-
independent view.
3. Why Analysis of Algorithm is Necessary?
Algorithm analysis is important in practice because the accidental or
unintentional use of an inefficient algorithm can significantly impact K1 CO1 S
system performance. In time-sensitive applications, an algorithm taking too
long to run can render its results outdated or useless.

4. What is data structure? Give Examples.


Data Structure can be defined as the group of data elements which provides
an efficient way of storing and organising data in the computer so that it can K1 CO1 A
be used efficiently. Some examples of Data Structures are arrays, Linked
List, Stack, Queue, etc.

5. What are the disadvantages of linked lists over arrays?


Memory usage
Traversal K1 CO1 S
Reverse Traversing
Random Access
6. Give the linked representation of the following polynomial:
10x4+20x3+10x2 +7x+8.
K1 CO1 S
10 4-----20 3-----10 2-------7 1-----8 null

7. What is circular linked list? State its advantage.


Circular Linked Lists can be used to manage the computing resources of
the computer. Data structures such as stacks and queues are implemented K2 CO1 A
with the help of the circular linked lists. Circular Linked List is also used in
the implementation of advanced data structures such as a Fibonacci Heap.
8. What are the two variants of header linked list?
 Grounded Header Linked List. It is a list whose last node
contains the NULL pointer. In the header linked list the start
pointer always points to the header node. ... K1 CO1 S
 Circular Header Linked List. A list in which last node points
back to the header node is called circular linked list.

9. Give the advantages and uses of doubly circular linked list.


Reversing the doubly linked list is very easy. It can allocate or reallocate
memory easily during its execution. As with a singly linked list, it is the K2 CO1 S
easiest data structure to implement. The traversal of this doubly linked list is
bidirectional which is not possible in a singly linked list.

10. What is doubly linked list?


A doubly linked list has two pointers 'left' and 'right' which enable it to
traverse in either direction. Compared to singly liked list which has only a
'next' pointer, doubly linked list requires extra space to store this extra
K1 CO1 A
pointer.

11. Mention the operations that can be performed on a stack.


 push() to insert an element into the stack.
 pop() to remove an element from the stack.
 top() Returns the top element of the stack.
K2 CO2 A
 isEmpty() returns true is stack is empty else false.
 size() returns the size of stack.

12. Differentiate linked stack from linear stack? K2 CO2 A

13. Give the postfix of : a + b * c + (d + e + f ) / g K3 CO2 S

14. Why are parenthesis not required in postfix/prefix expressions?


Parenthesis is not required because the order of the operators in the
K2 CO2 S
postfix and prefix expressions determines the actual order of
operations in evaluating the expression.

15. List out the operations in stack. Give examples.


 push() to insert an element into the stack.
 pop() to remove an element from the stack.
 top() Returns the top element of the stack. K1 CO2 A
 isEmpty() returns true is stack is empty else false.
 size() returns the size of stack.

16. State the rules to be followed during infix to postfix conversions K2 CO2 S

17. What are the conditions to be checked before inserting a new element in a K2 CO2 S
circular queue?
There are two conditions for inserting a new node into the linked circular
queue. In the first condition, you will insert a new node into an empty queue.
In this case, both the front and rear pointer must be Null. You must check it
using the condition rear == -1

18. What is priority queue? What are the ways to implement priority queue?
A priority queue is a special type of queue in which each
element is associated with a priority value. And, elements are K2 CO2 A
served on the basis of their priority. That is, higher priority
elements are served first. Priority queue can be implemented using the
following data structures: Arrays. Linked list. Heap data structure.

19. Mention some of the applications of priority queue.


 It is used in the Dijkstra's shortest path algorithm.
 It is used in prim's algorithm.
 It is used in data compression techniques like Huffman code.
K2 CO2 S
 It is used in heap sort.
 It is also used in operating system like priority scheduling, load
balancing and interrupt handling

20. Represent circular queue with a diagram and list its operations.
A circular queue is the extended version of a regular
queue where the last element is connected to the first
K1 CO2 A
element. Thus forming a circle-like structure.
Enqueue operation
Dequeue operation
21. What do you mean by level of tree?
In a tree, each step from top to bottom is called as level of a tree. The K1 CO3 A
level count starts with 0 and increments by 1 at each level or step.

22. What is the depth of a complete binary tree?


Th e depth of a node in a binary tree is the length of the path from the root of the
tree to that node. That is, the root has depth 0, its children have depth 1, its K3 CO3 S
grandchildren have depth 2, and so on. In a balanced tree, all the leaves in the tree
are about the same depth.

23. What is a complete binary tree?


A complete binary tree is a special type of binary tree where all the levels of the
K1 CO3 A
tree are filled completely except the lowest level nodes which are filled from as
left as possible.

24. What is Binary Search Tree?


K1 CO3 A
A binary search tree is a rooted binary tree in which the nodes are arranged in total
order in which the nodes with keys greater than any particular node is stored on the
right sub-trees and the ones with equal to or less than are stored on the left sub-tree
satisfying the binary search property.

25. What is height balanced Tree?


A height-balanced binary tree is defined as a binary tree in which the height of
K1 CO3 S
the left and the right subtree of any node differ by not more than 1. AVL tree,
red-black tree are examples of height-balanced trees.

26. Show the result of inorder traversal of the binary search tree given in below
Figure.

K3 CO3 S

27. What is B-tree?


a B-tree is a self-balancing tree data structure that maintains sorted data and
allows searches, sequential access, insertions, and deletions in logarithmic time. K1 CO3 A
The B-tree generalizes the binary search tree, allowing for nodes with more than
two children.

28. What is one-way threading?


In one-way threaded binary trees, a thread will appear either in the right
or left link field of a node. If it appears in the right link field of a node then it K1 CO3 S
will point to the next node that will appear on performing in order traversal.
Such trees are called Right threaded binary trees.

29. What is B+-tree?


The B+-tree is a tree structure where every node corresponds to a disk
block and which satisfies the following properties: The tree is balanced, i.e., K1 CO3 A
every leaf node has the same depth. An internal node stores a list of keys
and a list of pointers.

30. What are the properties of binary heap?


The heap data structure is an ordinary binary tree with two properties. The
shape property and the heap property. The shape property states that the
K2 CO3 A
tree is perfectly balanced and that the elements at the bottom level are
pushed as far to the left as possible. This property is best described
graphicaly.

31. What is meant by strongly connected in a graph?


A directed graph is called strongly connected if there is a path in each
direction between each pair of vertices of the graph. That is, a path
exists from the first vertex in the pair to the second, and another path exists
K1 CO4 A
from the second vertex to the first.
32. What are the representation of graphs?
A graph can be represented using 3 data structures- adjacency matrix, K1 CO4 A
adjacency list and adjacency set.

33. What is topological sorting?


The topological sort algorithm takes a directed graph and returns an array
of the nodes where each node appears before all the nodes it points to.
The ordering of the nodes in the array is called a topological ordering. Here's
an example: Since node 1 points to nodes 2 and 3, node 1 appears before
them in the ordering.

K1 CO4 S

34. Mention some of the applications of Depth First Search.


Depth-first search is used in topological sorting, scheduling problems,
cycle detection in graphs, and solving puzzles with only one solution, K2 CO4 S
such as a maze or a sudoku puzzle. Other applications involve analyzing
networks, for example, testing if a graph is bipartite.

35. Write down any 4 types of graph with its diagrammatic representation.
Undirected
Directed K1 CO4 S
Weighted
unweighted

36. Define adjacency list.


an adjacency list is a collection of unordered lists used to represent a
K1 CO4 A
finite graph. Each unordered list within an adjacency list describes the set of
neighbors of a particular vertex in the graph

37. What is articulation point or cut-vertex?


A vertex is said to be an articulation point in a graph if removal of the vertex
and associated edges disconnects the graph. So, the removal of articulation K1 CO4 S
points increases the number of connected components in a
graph. Articulation points are sometimes called cut vertices.

38. What is Euler circuit or Euler tour or Euler path?


An Euler path is a path that uses every edge of a graph exactly
once. An Euler circuit is a circuit that uses every edge of a graph K1 CO4 S
exactly once. ▶ An Euler path starts and ends at different vertices. ▶ An
Euler circuit starts and ends at the same vertex.

39. Mention some of the applications of graph.


 Graphs are used to define the flow of computation.
 Graphs are used to represent networks of communication. K2 CO4 S
 Graphs are used to represent data organization.
 Graph transformation systems work on rule-based in-memory
manipulation of graphs.

40. State the requirements of Euler circuit and path in directed graph.
The Euler Circuit is a special type of Euler path. When the starting vertex of
the Euler path is also connected with the ending vertex of that path, then it is K1 CO4 A
called the Euler Circuit. The graph must be connected. The in-degree and
out-degree of each vertex must be the same.

41. What do you mean by internal sorting and external sorting?


Internal sorting: If the input data is such that it can be adjusted in the main
memory at once, it is called internal sorting. External sorting: If the input data K1 CO5 A
is such that it cannot be adjusted in the memory entirely at once, it needs to
be stored in a hard disk, floppy disk, or any other storage device.

42. What are the advantage and disadvantage of separate chaining and linear
probing?

K2 CO5 S

43. What is selection sort?


Selection sort is an effective and efficient sort algorithm based on
comparison operations. It adds one element in each iteration. You need to K1 CO5 A
select the smallest element in the array and move it to the beginning of the
array by swapping with the front element.

44. Write the routine for insertion sort. K3 CO5 S

45. What is radix sort?


Radix Sort algorithm is a stable sorting subroutine-based integer sorting
algorithm. It is a sorting algorithm that does not use comparisons to sort a K1 CO5 A
collection of integers. It classifies keys based on individual digits with the
same significant position and value.

46. Mention the properties of good hash function.


There are four main characteristics of a good hash function: 1) The hash
value is fully determined by the data being hashed. 2) The hash function
K2 CO6 S
uses all the input data. 3) The hash function "uniformly" distributes the data
across the entire set of possible hash values. 4) The hash function generates
very different hash values for similar strings.
47. Calculate the hash values for the keys 1234 and 5642 using mid square
method. Consider that the hash table has 100 memory locations.

K3 CO6 S

48. Given the hash value of 100 locations, calculate the hash value using folding
method for the keys 5678 and 321.

K3 CO6 S

49. What is double hashing and rehashing?


Double hashing is a computer programming technique used in
conjunction with open addressing in hash tables to resolve hash
K1 CO6 A
collisions, by using a secondary hash of the key as an offset when a
collision occurs. Double hashing with open addressing is a classical data
structure on a table .

50. Write note of extendible hashing.


Extendible hashing is a type of hash system which treats a hash as a bit
string and uses a trie for bucket lookup. Because of the hierarchical K1 CO6 A
nature of the system, re-hashing is an incremental operation (done one
bucket at a time, as needed).

You might also like