ICSMCE1-13: PROGRAMMING LAB
Experiment 1. Write a program to store k keys into an array of size n at the location
computed using a hash function, loc = key % n, where k<=n and k takes values from [1 to
m], m>=n. To handle the collisions use the following collision resolution techniques:
A. Linear probing
B. Quadratic probing
C. Random probing
D. Double hashing/rehashing Implement the above program using hash function from:
(i) Division methods
(ii) Truncation methods
(iii) Folding methods
Experiment 2. Write a program to perform string matching using Rabin-Karp algorithm.
Experiment 3. Write a program to perform string matching using Finite Automata.
Experiment 4. Write a program to perform string matching using Knuth-Morris-Pratt
algorithm.
Experiment 5. Write a program to perform string matching using Boyer-Moore algorithm.
Experiment 6. Write a program for Binary Search Tree to implement the following
operations:
a. Insertion
b. Deletion
i. Delete node with only child
ii. Delete node with both children
c. Finding an element
d. Finding Min element
e. Finding Max element
f. Left child of the given node
g. Right child of the given node
h. Finding the number of nodes, leaves nodes, full nodes, ancestors, descendants.
Experiment 7. Write a program to implement Inorder Threaded Binary Tree with insertion
and deletion operation.
Experiment 8. Write a program to implement Preorder Threaded Binary Tree with insertion
and deletion operation.
Experiment 9. Write a program to implement Postorder Threaded Binary Tree with
insertion and deletion operation.
Experiment 10. Write a program to transform BST into Threaded Binary Tree.
Experiment 11. Write a program for AVL Tree to implement following operations (For
nodes as integers):
a. Insertion: Test Program for all cases (LL, RR, RL, LR rotation)
b. Deletion: Test Program for all cases (R0, R1, R-1, L0, L1, L-1)
c. Display: using set notation.
Experiment 12. Write a program to implement Red-Black trees with insertion and deletion
operation for the given input data as Strings.
Experiment 13. Write a program to transform BST into AVL trees and also count the
number rotations performed.
Experiment 14. Write a program to find the black height of any given node in Red-Black tree
and find the black height of the Red-Black tree.
Experiment 15. Write a program to implement insertion, deletion, display and search
operation in m-way B tree (i.e. a non-leaf node can have at most m children) for the given
data as integers (Test the program for m=3, 5, 7).
ICSMCE1-14: FIELD WORK