Assignment 7: Dictionary

Due: Nov 27, 11.55PM

(Submit at moodle.)

Write a program to implement a Dictionary of integers which consists of following methods:

The input for the program must be from the file input.txt. For example, the input.txt might contain the following sequence of operations

I(5) // I for insert
I(7)
I(5)
R(7) // R is used for delete
F(12) // F for find
D // D is used for display

The output should be written in a file output.txt. For example, for the above sequence of inputs, the Dictionary will generate the following output

Element 5
Inserted Element 7
Inserted Duplicate Element
Element 7 Deleted
5
5

The assignment is divided into following parts:

PART-A : Implement the dictionary using a sorted array. Here you will be required to implement find operation using linear and binary search. The class name should be SortedArray

PART-B : Implement the dictionary using a sorted linked list. Here you will be required to implement find operation using only linear search. The class name should be SortedList.

Notes: