Professional Documents
Culture Documents
University Questions
University Questions
University Questions
UNIT - 1
4. How will you perform space and time analysis of an algorithm. Explain with example.[3
times]
UNIT – 2
1. Explain how an array can be used for storing a sparse matrix. Discuss the advantages of
sparse matrix.[5 times repeated]
4. What is circular queue? Explain the operations with algorithms.[3 times repeated]
6. Explain the operations performed on Stack and Queue with algorithms.[3 times repeated]
7. Explain the operations performed in single and double linked list with examples and
algorithms.[2 times repeated]
UNIT – 3
4. What is Graph? Explain the terminologies, representation and shortest path algorithm. [3
times]
UNIT – 4
1. Explain about hash tables. What are the different properties of a hash function give
suitable examples. [6 times]
5. What are symbol tables? Explain the structure of symbol table.[6 times]
6. What are the constraints to be considered in the design of symbol table? Explain them.
Develop an algorithm to construct a symbol table. [ 1 time]
7. What is Symbol table and what are its types. Explain. [ 1 time]
UNIT – 5
b. 0(n logn) time suffixes if there are two takes to use as external storage.
2. List out the areas in which data structures are applied extensively?
Ø Compiler Design,
Ø Operating System,
Ø Database Management System,
Ø Statistical analysis package,
Ø Numerical Analysis,
Ø Graphics,
Ø Artificial Intelligence,
Ø Simulation
3. What are the major data structures used in the following areas : RDBMS, Network
data model & Hierarchical data model.
Ø RDBMS – Array (i.e. Array of structures)
Ø Network data model – Graph
Ø Hierarchical data model – Trees
4. If you are using C language to implement the heterogeneous linked list, what pointer
type will you use?
The heterogeneous linked list contains different data types in its nodes and we
need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So
we go for void pointer. Void pointer is capable of storing pointer to any type as it is a
generic pointer type.
7. What are the notations used in Evaluation of Arithmetic Expressions using prefix and
postfix forms?
Polish and Reverse Polish notations.
14. List out few of the applications that make use of Multilinked Structures?
Ø Sparse matrix,
Ø Index generation.
16. What is the type of the algorithm used in solving the 8 Queens problem?
Backtracking
17. In an AVL tree, at what condition the balancing is to be done?
If the ‘pivotal value’ (or the ‘Height factor’) is greater than 1 or less than –1.
18. What is the bucket size, when the overlapping and collision occur at same time?
One. If there is only one entry possible in the bucket, when the collision occurs,
there is no way to accommodate the colliding value. This results in the overlapping of
values.
19. Traverse the given tree using Inorder, Preorder and Postorder traversals.
A
BC
DEFG
Given tree:
Ø Inorder : D H B E A F C I G J
Ø Preorder: A B D H E C F G I J
Ø Postorder: H D E B F I J G C A
20. There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could
have formed a full binary tree?
15.
In general:
There are 2n-1 nodes in a full binary tree.
By the method of elimination:
Full binary trees contain odd number of nodes. So there cannot be full
binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete
binary tree but not a full binary tree. So the correct answer is 15.
Note:
Full and Complete binary trees are different. All full binary trees are complete
binary trees but not vice versa.
21. In the given binary tree, using array you can store the node 4 at which location?
At location 6
123--4--5
1
23
4
5
Root LC1 RC1 LC2 RC2 LC3 RC3 LC4 RC4
where LCn means Left Child of node n and RCn means Right Child of node n
23. For the given graph, draw the DFS and BFS?
Ø BFS: A X G H P E M Y J
Ø DFS: A X H P E Y M J G
24. Classify the Hashing Functions based on the various methods by which the key value
is found.
Ø Direct method,
Ø Subtraction method,
Ø Modulo-Division method,
Ø Digit-Extraction method,
Ø Mid-Square method,
Ø Folding method,
Ø Pseudo-random method.
25. What are the types of Collision Resolution Techniques and the methods used in each
of the type?
Ø Open addressing (closed hashing),
The methods used include:
Overflow block,
Ø Closed addressing (open hashing)
The methods used include:
Linked list,
Binary tree…
26. In RDBMS, what is the efficient data structure used in the internal storage
representation?
B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes
searching easier. This corresponds to the records that shall be stored in leaf nodes.
27. Draw the B-tree of order 3 created by inserting the following data arriving in
sequence – 92 24 6 7 11 8 22 4 5 16 19 20 78
The given graph:
11 -
5 7 19 24
28.Of the following tree structure, which is, efficient considering space and
time complexities?
(a) Incomplete Binary Tree
(b) Complete Binary Tree
(c) Full Binary Tree
(b) Complete Binary Tree.
By the method of elimination:
Full binary tree loses its nature when operations of insertions and deletions
are done. For incomplete binary trees, extra storage is required and overhead of NULL
node checking takes place. So complete binary tree is the better one since the property of
complete binary tree is maintained even after operations like additions and deletions are
done on it.
35. For the following COBOL code, draw the Binary tree?
01 STUDENT_REC.
-
**
AB+/
CDPQ
1
2
3
45
410 612
200
310
02 NAME.
03 FIRST_NAME PIC X(10).
03 LAST_NAME PIC X(10).
02 YEAR_OF_STUDY.
03 FIRST_SEM PIC XX.
03 SECOND_SEM PIC XX.
STUDENT_REC
NAME YEAR_OF_STUDY
FIRST_NAME LAST_NAME FIRST_SEM SECOND_
UNIT - 1
1.Write down the definition of data structures?
A data structure is a mathematical or logical way of organizing data in the memory that consider
not only the items stored but also the relationship to each other and also it is characterized by
accessing functions.
2.What is meant by problem solving?
Problem solving is a creative process, which needs systemization and mechanization.
3. Give few examples for data structures?
Stacks, Queue, Linked list, Trees, graphs
4. What is problem definition phase?
The first step in solving a problem is to understand problem clearly. Hence, the first phase is the
problem definition phase. That is, to extract the task from the problem statement. If the problem
is not understood, then the solution will not be correct and it may result in wastage of time and
effort.
5. Define Algorithm?
Algorithm is a solution to a problem independent of programming language. It consist of set of
finite steps which, when carried out for a given set of inputs, produce the corresponding output
and terminate in a finite time.
6. Define Program?
Set of instructions to find the solution to a problem. It is expressed in a programming language in
an explicit and unambiguous manner.
7. Mention how similarities among the problems are used in problem solving?
This method is used to find out if a problem of this sort has been already solved and to adopt a
similar method in solving the problem. The contribution of experience in the previous problem
with help and enhance the method of problem for the current problem.
8. What is working backward from the solution?
When we have a solution to the problem then we have to work backward to find the starting
condition. Even a guess can take us to the starting of the problem. This is very important to
sytematize the investigation to avoid duplication of our effort.
9. Mention some of the problem solving strategies?
The most widely strategies are listed below
PART-B
1.Explain top-down design in detail?
• Definition
• Breaking a problem in to subproblems
• Choice of a suitable data structure
• Constructions of loops
• Establishing initial conditions for loops
• Finding the iterative construct
• Terminations of loops
2. What are the steps taken to improve the efficiency of an algorithm?
• Definition
• Redundant computations
UNIT –II
PART-A
1.What is meant by an abstract data type?
An ADT is a set of operation. Abstract data types are mathematical abstractions.Eg.Objects such
as list, set and graph along their operations can be viewed as ADT's.
2. What are the operations of ADT?
Union, Intersection, size, complement and find are the various operations of ADT.
3. What is meant by list ADT?
List ADT is a sequential storage structure. General list of the form a1, a2, a3.…., an and the size
of the list is 'n'. Any element in the list at the position I is defined to be ai, ai+1 the successor of
ai and ai-1 is the predecessor of ai.
4. What are the various operations done under list ADT?
• Print list
• Insert
• Make empty
• Remove
• Next
• Previous
• Find kth
5. What are the different ways to implement list?
• Simple array implementation of list
• Linked list implementation of list
6. What are the advantages in the array implementation of list?
a) Print list operation can be carried out at the linear time
b) Fint Kth operation takes a constant time
7. What is a linked list?
Linked list is a kind of series of data structures, which are not necessarily adjacent in memory.
Each structure contain the element and a pointer to a record containing its successor.
8. What is a pointer?
Pointer is a variable, which stores the address of the next element in the list. Pointer is basically a
number.
9. What is a doubly linked list?
In a simple linked list, there will be one pointer named as 'NEXT POINTER' to point the next
element, where as in a doubly linked list, there will be two pointers one to point the next element
and the other to point the previous element location.
10. Define double circularly linked list?
In a doubly linked list, if the last node or pointer of the list, point to the first element of the list,
then it is a circularly linked list.
Queue is a first - in -first out list. The operations that can be done with queue are addition and
deletion.
20. What is a circular queue?
The queue, which wraps around upon reaching the end of the array is called as circular queue.
PART-B
• Explanation
• Example
_ Multilist
• Explanation
• Example figure
4. Explain the linked list implementation of stack ADT in detail?
_ Definition for stack
_ Stack model
_ Figure
_ Pointer-Top
_ Operations
• Coding
• Example figure
5. Explain the array implementation of queue ADT in detail?
_ Definition for stack
_ Stack model
_ Figure
_ Pointer-FRONT, REAR
_ Operations
• Coding
• Example figure
UNIT-III
PART-A
1. Define non-linear data structure
Data structure which is capable of expressing more complex relationship than that of physical
adjacency is called non-linear data structure.
2. Define tree?
A tree is a data structure, which represents hierarchical relationship between individual data
items.
3. Define leaf?
In a directed tree any node which has out degree o is called a terminal node or a leaf.
4. What is meant by directed tree?
Directed tree is an acyclic diagraph which has one node called its root with indegree o whille all
other nodes have indegree I.
5. What is a ordered tree?
In a directed tree if the ordering of the nodes at each level is prescribed then such a tree is called
ordered tree.
6. What are the applications of binary tree?
Binary tree is used in data processing.
a. File index schemes
b. Hierarchical database management system
7. What is meant by traversing?
Traversing a tree means processing it in such a way, that each node is visited only once.
8. What are the different types of traversing?
The different types of traversing are
a. Pre-order traversal-yields prefix from of expression.
b. In-order traversal-yields infix form of expression.
c. Post-order traversal-yields postfix from of expression.
9. What are the two methods of binary tree implementation?
Two methods to implement a binary tree are,
a. Linear representation.
b. Linked representation
10. Define pre-order traversal?
Pre-order traversal entails the following steps;
a. Process the root node
b. Process the left subtree
c. Process the right subtree
11.Define post-order traversal?
Post order traversal entails the following steps;
a. Process the left subtree
d. Multiplicative hashing
e. Digit analysic
20. What are the problems in hashing?
a. Collision
b. Overflow
21. What are the problems in hashing?
When two keys compute in to the same location or address in the hash table
through any of the hashing function then it is termed collision.
PART-B
1. Explain the different tree traversals with an application?
_ In order
• Explanation with an example
• Figure
_ Preorder
• Explanation with an example
• Figure
_ Postorder
• Explanation with an example
• Figure
2. Define binary search tree? Explain the various operations with an example?
_ Definition
_ Figure for binary search tree
_ Operations
• Codings
• Explanation
• Example
3. Define AVL trees? Explain the LL, RR, RL, LR case with an example?
_ Definition
_ LL, RR, RL, LR case
• Figure
• Example
• Explanation
4. Define priority queue? Explain the basic heap operation with an example?
_ Definition
_ Basic operation
• Insert
• Delmin
• Delmax
_ Coding
_ Explanation
_ Example
5. Explain any two techniques to overcome hash collision?
_ Separate chaining
• Example
• Explanation
• Coding
_ Open addressing
• Linear probing
• Quadratic probing
UNIT-IV
PART-A
1.What is meant by sorting?
Ordering the data in an increasing or decreasing fashion according to some relationship among
the data item is called sorting.
2. What are the two main classifications of sorting based on the source of data?
a. Internal sorting
b. External sorting
3. What is meant by external sorting?
External sorting is a process of sorting in which large blocks of data stored in storage devices are
moved to the main memory and then sorted.
c. Merge sorting
15. When is a sorting method said to be stable?
A sorting method is said to be stable, it two data items of matching values are guaranteed to be
not rearranged with respect to each other as the algorithm progresses.
16. Name some simple algorithms used in external sorting?
a. Multiway merge
b. Polyphase merge
c. Replacement selection
17. When can we use insertion sort?
Insertion sort is useful only for small files or very nearly sorted files.
18. How many passes are required fork-way merging?
The number of passes required using k-way merging is [log k (n/m)] because the N H S get k
times as large in each pass.
19. Define max heap?
A heap in which the parent has a larger key than the child's is called a max
heap.
20. Define min heap?
A heap in which the parent has a smaller key than the child's is called a min heap.
PART-B
1.Explain heap sort with an example?
• Explanation
• Example
• Figure
• Coding
2. Explain quick sort with an example?
• Explanation
• Example
• Figure
• Coding
3. Explain quick sort with an example?
• Explanation
• Example
• Figure
• Coding
4. Explain any four external sorting techniques with example?
• Explanation
• Example
• Figure
• Coding
5. Explain shell sort with an example?
• Explanation
• Example
• Figure
• Coding
PART-B
1.Explain heap sort with an example?
_ Explanation
_ Example
_ Figure
_ Coding
2. Explain quick sort with an example?
_ Explanation
_ Example
_ Figure
_ Coding
3. Explain merge sort with an example?
_ Explanation
_ Example
_ Figure
_ Coding
4. Explain any four external sorting techniques with example?
_ Explanation
_ Example
_ Figure
_ Coding
5. Explain shell sort with an example?
_ Explanation
_ Example
_ Figure
_ Coding
UNIT-V
PART-A
1.Define Graph?
A graph G consist of a nonempty set V which is a set of nodes of the graph, a set E which is the
set of edges of the graph, and a mapping from the set for edge E to a set of pairs of elements of
V. It can also be represented as G=(V, E).
2. Define adjacent nodes?
Any two nodes which are connected by an edge in a graph are called adjacent nodes. For
example, if and edge xÎE is associated with a pair of nodes (u,v) where u, v Î V, then we say that
the edge x connects the nodes u and v.
3. What is a directed graph?
A graph in which every edge is directed is called a directed graph.
4. What is a undirected graph?
A graph in which every edge is undirected is called a directed graph.
5. What is a loop?
An edge of a graph which connects to itself is called a loop or sling.
6.What is a simple graph?
A simple graph is a graph, which has not more than one edge between a
pair of nodes than such a graph is called a simple graph.
7. What is a weighted graph?
A graph in which weights are assigned to every edge is called a weighted
graph.
_ Graph
_ Table
_ Coding
5. Explain Krushal's algorithm with an example?
_ Explanation
_ Example
_ Graph
_ Table
_ Coding