Data Structure Laboratory Exercises: Iii Semester Information Science & Enginerring
Data Structure Laboratory Exercises: Iii Semester Information Science & Enginerring
III SEMESTER
INFORMATION SCIENCE & ENGINERRING
P M Shivamurthy
Department of Computer Science and Engineering
Sri Jayacharajendra College Of Enginnering
Mysore-570006
Contents
1 Exercises on Primitive Data Structures
1
1
2
3
2.1
Exercises Arrays
1. Addressing opertions
1. Store nelements into an array using address computing technique
2. display the address and the value of members of the array
3. Implement a mutitype arrays
2. Demostrate the linearity of addresses of array elements of both one
dimension and two-dimensions.
3. Using 2-D array representation for a polynomial, design, develop, and
execute a program in C to accept two polynomials, add them, and then
print the resulting polynomial.
1
4. Design, develop, and execute a program in C & C++ based on the following requirements: An EMPLOYEE class is to contain the following
data members and member functions:
Data: Employee Number (an integer), Employee Name (a string of
characters),Basic Salary (an integer) , All Allowances (an integer), IT
(an integer), Net Salary (an integer).
Functions: to read the data of an employee, to calculate Net Salary
and to print the values of all the data members. (All Allowances =
123% of Basic; Income Tax (IT) = 30% of the gross salary (= basic Salary All Allowance); Net Salary = Basic Salary + All Allowances
IT)
use structures in C and class in C++
5. Design, develop, and execute a program in C & C++ to implement
the following operations on Strings. Display the results after every
operation.
1 Concatenation
2 Search & replace
3 Length
For C++, define a class called STRING & use operator overloading
6. Design, develop, and execute a program in C to create a max heap of
integers by accepting one element at a time and by inserting it immediately in to the heap. Use the array representation for the heap. Display
the array at the end of insertion phase.
2.2
Exercises on Stack
4. Solve the tower of hanoi puzzle with the help of explicit stack to simulate the recursion.
2.3
Exercises on Queues
AVL Tree
2-3 Trees
Red-Black Trees
B-Tree