DATA STRUCTURE AND APPLICATIONS
MODULE I
1. Define data structure. Explain various operations on data structure (6)
2. Define data structure. Explain the classification of data structure with examples (6)
3. What is structure? Explain the different types of structure with example and give
difference between union and structure (10)
4. List and explain the functions supported in C for dynamic memory allocation (7)
5. Write a c program to demonstrate the basic operations on arrays (8)
6. Explain any four string handling functions supported by c with syntax and example(6)
7. What is Sparse matrix? Write the ADT of Sparse matrix. Give the triplet form of a given
matrix and also find its transpose.(8)
7 0 0 0 0
0 0 9 0 0
3 0 2 0 0
0 0 0 0 5
8. Define Pointers. How to declare and initialize pointers, explain with example(5)
9. Define stack. List and explain the various operations on stacks using arrays with stack
overflow and stack underflow conditions (10)
10. Write a c program to perform push(), pop(), display operations on STACK (10)
11. Develop a C recursive program for Tower of Hanoi problem. Trace it for 3 disks with
schematic call tree diagram (8)
12. Write an algorithm to convert an infix expression to postfix expression and also trace the
same for the expression (a+b)*d+e/f+c
13. Write an algorithm to evaluate postfix expression and apply the same for the given
postfix expression. ABC-D*+E$F+ and assume A=6 B=3 C=2 D=5 E=1 F=7
14. Convert the following infix expression into postfix expression using stack (5)
A + (B*C-(D/E^F)*G)*H
, 1. Define data structure. Explain various operations on data structure (6)
Definition
“Data structure is defined as the way of storing and organizing data elements by referring its
relationship to each other for efficient usage”
OPERATIONS ON DATA STRUCTURES
The data stored in the data structure can be processed by certain operations.
There are Five basic Operations:
1. Create
To create a new data structure and allocate memory
2. Insert
To add a new node into the data structure
Ex: to add the details of a new student who has recently joined
3. Delete
To remove an existing node from the data structure
Ex: to delete the name of a student who has left the course
4. Traverse
To access each node exactly once so that the nodes of a data structure can be
processed
Also called as visiting
Ex: to print the names of all the students in a class
5. Search
To find the location of a node for a given key value
The key data may or may not be present in the data structure
Ex: to find the names of all the students who secured 100 marks in mathematics
Other Operations
1. Sorting
arranging the data in a particular order i.e Ascending or Descending Order
Ex: arranging the names of students in a class in an alphabetical order
2. Merging
two sorted data items can be combined to form a single list of sorted data items.
Joining two lists
2. Define data structure. Explain the classification of data structure with examples (6)
Definition
“Data structure is defined as the way of storing and organizing data elements by referring its
relationship to each other for efficient usage”
Classification Of Data Structures
, Data structures are generally categorized into two classes:
Primitive data structures
Non-primitive data structures
Primitive data structure
The basic data types supported by all programming languages are called Primitive Data
Structure.
These data structures are directly operated upon by machine level instructions
Used to represent single values
Example: integer, float, double, character, String and Boolean.
Non-primitive data structure
The data structures which are derived by primitive data structures are called Non-
Primitive Data structures.
It is used to store group of values
Example: Arrays, Structure, Union, linked lists, stacks, Queue, trees, and graphs.
Non-primitive data structures can further be classified into two categories:
o Linear data structure
o Non-linear data structure
Linear data structure
If the elements of a data structure are stored in a linear or sequential order, then it is a
linear data structure.
It establishes the adjacency relationship between the elements
Two different Representations
o Sequential Memory Representation
Represents linear relationship between elements by means of sequential
memory locations
Example: Arrays, Queue, Stack
o Linked or Pointer Representation
MODULE I
1. Define data structure. Explain various operations on data structure (6)
2. Define data structure. Explain the classification of data structure with examples (6)
3. What is structure? Explain the different types of structure with example and give
difference between union and structure (10)
4. List and explain the functions supported in C for dynamic memory allocation (7)
5. Write a c program to demonstrate the basic operations on arrays (8)
6. Explain any four string handling functions supported by c with syntax and example(6)
7. What is Sparse matrix? Write the ADT of Sparse matrix. Give the triplet form of a given
matrix and also find its transpose.(8)
7 0 0 0 0
0 0 9 0 0
3 0 2 0 0
0 0 0 0 5
8. Define Pointers. How to declare and initialize pointers, explain with example(5)
9. Define stack. List and explain the various operations on stacks using arrays with stack
overflow and stack underflow conditions (10)
10. Write a c program to perform push(), pop(), display operations on STACK (10)
11. Develop a C recursive program for Tower of Hanoi problem. Trace it for 3 disks with
schematic call tree diagram (8)
12. Write an algorithm to convert an infix expression to postfix expression and also trace the
same for the expression (a+b)*d+e/f+c
13. Write an algorithm to evaluate postfix expression and apply the same for the given
postfix expression. ABC-D*+E$F+ and assume A=6 B=3 C=2 D=5 E=1 F=7
14. Convert the following infix expression into postfix expression using stack (5)
A + (B*C-(D/E^F)*G)*H
, 1. Define data structure. Explain various operations on data structure (6)
Definition
“Data structure is defined as the way of storing and organizing data elements by referring its
relationship to each other for efficient usage”
OPERATIONS ON DATA STRUCTURES
The data stored in the data structure can be processed by certain operations.
There are Five basic Operations:
1. Create
To create a new data structure and allocate memory
2. Insert
To add a new node into the data structure
Ex: to add the details of a new student who has recently joined
3. Delete
To remove an existing node from the data structure
Ex: to delete the name of a student who has left the course
4. Traverse
To access each node exactly once so that the nodes of a data structure can be
processed
Also called as visiting
Ex: to print the names of all the students in a class
5. Search
To find the location of a node for a given key value
The key data may or may not be present in the data structure
Ex: to find the names of all the students who secured 100 marks in mathematics
Other Operations
1. Sorting
arranging the data in a particular order i.e Ascending or Descending Order
Ex: arranging the names of students in a class in an alphabetical order
2. Merging
two sorted data items can be combined to form a single list of sorted data items.
Joining two lists
2. Define data structure. Explain the classification of data structure with examples (6)
Definition
“Data structure is defined as the way of storing and organizing data elements by referring its
relationship to each other for efficient usage”
Classification Of Data Structures
, Data structures are generally categorized into two classes:
Primitive data structures
Non-primitive data structures
Primitive data structure
The basic data types supported by all programming languages are called Primitive Data
Structure.
These data structures are directly operated upon by machine level instructions
Used to represent single values
Example: integer, float, double, character, String and Boolean.
Non-primitive data structure
The data structures which are derived by primitive data structures are called Non-
Primitive Data structures.
It is used to store group of values
Example: Arrays, Structure, Union, linked lists, stacks, Queue, trees, and graphs.
Non-primitive data structures can further be classified into two categories:
o Linear data structure
o Non-linear data structure
Linear data structure
If the elements of a data structure are stored in a linear or sequential order, then it is a
linear data structure.
It establishes the adjacency relationship between the elements
Two different Representations
o Sequential Memory Representation
Represents linear relationship between elements by means of sequential
memory locations
Example: Arrays, Queue, Stack
o Linked or Pointer Representation