Can any body help me in that program ???
mail me if anybody could reach any -helpfull- thing
Write a C++ program that namely insert, delete, and search in a fixed record length file (containing a person’s name and age). Associated with the record file will be a file that stores a binary search tree index that allows for a quick search through the index. The required operations will be provided using an input file that will be specified in the command prompt. The file will have lines with the following format:
Required_Operation (tab) Name (tab) [Age]
where Required_Operation has a value of 1, 2, or 3 which corresponds to insert, delete, and search respectively.
The Name is a string with a maximum length of 20 characters.
The Age is an optional argument that is supplied only when an insert operation is required.
If the Required_Operation is an insertion or a deletion, the word “SUCSESS” (in all capital letters) is printed to STANDARD ERR.
If the Required_Operation is a search, the Age corresponding to the Name is printed to STANDARD OUT. If the search operation fails, the word “FAILED” (in all capital letters) is printed to STANDARD OUT.
The resultant record file has to be created using the mmap function and has to be able to accommodate up to exactly 32,768 records.
Associated with the record file is a bitmap file that is exactly 32,768 bits long that indicates which records are used or free. In a bitmap file, each bit corresponds to a record in the record file (bit 10 corresponds to record 10). If the bit is set to 1, then the corresponding record is used, and if the bit is 0, then the corresponding record is empty.
When inserting, use a first-fit strategy.
When deleting a record in the record file, simply set the corresponding bit in the bitmap file to 0.
Associated with the record file is a binary search tree that includes pointers to the locations in the record file corresponding to each Name. Since using the Name field would cause the index to be large and consequently inefficient, the value stored in each node of the binary tree is the Hash value of the Name (as mentioned earlier, using the SDBM Hash function is desirable).
Again use the mmap function to store the binary tree. Each node in the binary tree will include the value in the node (unsigned int), 2 pointers to the left and right children, and a pointer to the location of the record in the record file.
Like the record file, associated with binary tree file is a bitmap file that indicates which node positions are used or free. In a bitmap file,each bit corresponds to a node location in the binary tree file (bit 10 corresponds to node location 10). If the bit is set to 1, then the corresponding node location is used, and if the bit is 0, then the corresponding node location is empty. When inserting, use a first-fit strategy. When deleting a node, simply set the corresponding bit in the bitmap file to 0 and properly adjust the tree and the associated pointers.
Thanks in advance...