Professional Documents
Culture Documents
Subject
: 1. Dr. Balachandra
2. Mrs. Veena K M
No of contact hours/week : 03
TEST/ EXAM
LAB INTERNAL
TOPICS
Lab 1-Lab 8
FINAL EXAM
Lab1 Lab 12
Submitted by:
1. Dr. Balachandra
2. Mrs. Veena K M
(Signature of HOD)
Date:
Page 1 of 4
MIT/GEN/F-05/R
Lab
1
List of Programs
1. Write a program to search a given element in a list using
a. i) Linear search
ii) Binary search
2. Write a program to sort a given list of elements using
a. i) Bubble sort
ii) Selection sort iii)Insertion Sort
2.
3.
Page 2 of 4
MIT/GEN/F-05/R
8
9
Lab Test
1. Write recursive functions for
i) Creating a linked list
ii) Traversing a linked list.
2. Let x = (x1, x2..xn) and Y = (Y1, Y2.Yn) be 2 linked
lists. Assume that, in each list, the nodes are in non decreasing order
of the datafields values. Write an algorithm to merge the two lists
together to obtain a ndw linked list z in which the nodes are also in
this order. Following the merge, x and y do not exist as individual
lists. Each node initially in x or y is now in z. No additional nodes
may be used.
10
Page 3 of 4
i) In order traversal
ii) Post order traversal
iii) Preorder traversal
iv) print the parent of a given element
v) depth of the tree
vi) print the ancestors of a given element
vii) Count the no. of leaf nodes in a binary tree.
11
12
13
MIT/GEN/F-05/R
Page 4 of 4