CS 1151 Data Structures
CS 1151 Data Structures
CS 1151 Data Structures
PROBLEM SOLVING
PART-A
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.
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.
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
• Referencing array elements
• Inefficiency due to late termination
• Early detection of desired output conditions
• Trading storage for efficiency gains
19. Write down the operations that can be done with queue data structure?
Queue is a first - in -first out list. The operations that can be done with
queue are addition and deletion.
PART-B
1.Explain the linked list implementation of list ADT in Detail?
Definition for linked list
Figure for linked list
Next pointer
Header or dummy node
Various operations
• Explanation
• Example figure
• Coding
2. Explain the cursor implementation of linked list?
Definition for linked list
Figure for linked list
Next pointer
Header or dummy node
Various operations
• Explanation
• Example figure
• Coding
3. Explain the various applications of linked list?
Polynomical ADT
• Operations
• Coding
• Figure
Radix Sort
• Explanation
• Example
Multilist
• Explanation
• Example figure
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.
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
2. What are the two main classifications of sorting based on the source of data?
a. Internal sorting
b. External sorting
a. Polyphase merging
b. Oscillation sorting
c. Merge sorting
PART-B
1.Explain heap sort with an example?
• Explanation
• Example
• Figure
• Coding
5. What is a loop?
An edge of a graph which connects to itself is called a loop or sling.
18. What are the two traversal strategies used in traversing a graph?
a. Breadth first search
b. Depth first search