for full detail plz take a look at the attached word document
Write a program that implements a splay tree in C.
- Each node in the splay tree contains several fields: key, left, right and parent
- The key should be of type integer. Left, right and parent meanwhile are node
pointers
- Your splay tree should support the basic set operations: insert, delete and search
- For insert, you may assume that the keys are distinct
_ For delete and search, the key provided may or may not exist in the splay tree
_ Remember to perform splaying after each success/failed set operation
- The program should be initiated by typing \nameOfProgram inputFileName out-
putFileName" at the command line
- \inputFileName" is the name of a file that contains a list of set operations to be
executed
- An example input file:
i : 1,2,3,4
s : 2
d : 1,3
s : 5
Note that i, d and s represents insert, delete and search. So based on the example,
we are inserting keys: 1, 2, 3 and 4 into the splay tree. Then, we search for key:
2. We then delete keys: 1 and 3. Finally, we seach for key: 5 in the splay tree
- Note that after each set operation, the resulting splay tree should be printed to
the output file specified in the \outputFileName"
- Given the example input file, the resulting output file will contain a list of eight
splay trees, printed one after the another
- The splay tree printout should be of the following format:
Search : 2
======
Level 0:2
Level 1:1,3
Level 2:*,*,*,4
Level 3 :*,*
Based on the example input file, the above printout would be the splay tree after
executing a search for key 2. Note that level-order traversal should be used in the
printing of the splay tree. Each external node meanwhile should be represented
as a "*"
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Should run on UNIX and should be written in C no exceptions.