473,659 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need HELP in that program!

memoman
3 New Member
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_Operat ion (tab) Name (tab) [Age]

where Required_Operat ion 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_Operat ion is an insertion or a deletion, the word “SUCSESS” (in all capital letters) is printed to STANDARD ERR.
If the Required_Operat ion 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...
Attached Files
File Type: txt Program.txt (2.9 KB, 404 views)
Mar 24 '07 #1
4 1904
memoman
3 New Member
Please, I need HELP as fast as possible.

I've a little knowledge about C++, specially when dealing with Linus platforms like cygwin, you know mmap and these stuff.

Thanks in advance
Mar 24 '07 #2
sicarie
4,677 Recognized Expert Moderator Specialist
As per our Posting Guidelines (available in the FAQ), we can't do your program for you, you need to ask a specific question about what you are having difficulty with, and we'll try to point you in the right direction, or show you proper syntax.

SO what have you tried on this? What error messages are you getting?
Mar 24 '07 #3
memoman
3 New Member
As per our Posting Guidelines (available in the FAQ), we can't do your program for you, you need to ask a specific question about what you are having difficulty with, and we'll try to point you in the right direction, or show you proper syntax.

SO what have you tried on this? What error messages are you getting?

Ah I see, thanks for declaration.

But my big problem that I dunno how to start, and how to organize all this requirments in one program.
Mar 24 '07 #4
sicarie
4,677 Recognized Expert Moderator Specialist
Ah I see, thanks for declaration.

But my big problem that I dunno how to start, and how to organize all this requirments in one program.
Break them down into different programs. Do you know how the binary search tree algorithm works?

As I see it, you have a few main things to do - you have to create this index, from an input file stream, parse the line by tabs, and organize that index by struct/class or whatever.

From there, you can fill in the details as needed, but the trick is to get that overview - however works best for you. That's also part of the reason people diagram in UML, some people use the top-down method, and I (as you can see), make an outline. Class assignments go well with the outline method - you can put the big points down, and then fill in specific requirements for each main point. With the complexity of having he data, the index, and the bitmap, I would recommend UML - it's good for modeling the relationships between objects.
Mar 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3110
by: Spamtrap | last post by:
I only do occasional Perl programming and most things I write are short processes. I have something I'm working on that is scanning a text file with about 15 million lines and trying to extract matches from another text file, which has about 170 entries. The second text file is read into an array. The process then scans through the big file for certain possible patterns - it will find those in about 1 out of 25 lines,, when it finds one,...
2
2866
by: aj902 | last post by:
Hello , I am trying to create a program where all detail, http://www.albany.edu/~csi333/projects.htm
13
2458
by: vgame64 | last post by:
Hi, I have been struggling with writing a program for a few hours. The requirements are that: """You will be writing a program which will determine whether a date is valid in terms of days in that month. We are assuming that the year will be valid 4 digit integer. So you don't have to think much about that(in terms of validation) except for the month of February. If the month is February, then you have to check whether that year is Leap...
4
2203
by: robinsand | last post by:
My apologies to those of you who are more advanced Visual C++ .NET programmers, but I am working on a project for an MBA course that is condensed into an eight-week schedule, and I need help getting a program up and running with proper files and documentation to be handed in for a grade (on Microsoft Visual Studio .NET 2003). I am being graded on how well I incorporate advanced C++ features such as inheritance, polymorphic programming,...
4
2192
by: naknak4 | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
6
2122
by: naknak | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
1
5675
by: peterggmss | last post by:
This is a slot machine game, 2 forms. One is the actual game (frmMachine) and the other is in the background and randomizes the images shown on frmMachine. I need to make frmMachine wait for frmRandom, i tried it with the Sleep API and a Do/Until Loop and neither worked, could you please help me, I have my code below. frmMachine 'Slot Machine, (c) 2006 Peter Browne, GPL Licensed ' 'Peter Browne 'Sheridan Corporate Centre '2155 Leanne...
8
3006
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
4
1632
by: shyamkumars | last post by:
Hi, I would like to know how can I make a daemon program in perl,say DP . The said program need to call a a program say A, which will to parse huge text file. The run time of A may vary say 5 to 6 hrs on average. There will be a lot of execution request reach the daemon program(DP) parsing different text files. so I need this daemon program to schedule each request in proper interval of time. I need to call the program from a web...
1
1964
by: raghavshastri | last post by:
You are to write a C++ program to perform a statistical analysis of the blobs in an image. The image will be a grayscale image in PGM format for simplicity. Here is a sample PGM image with 10 columns and 4 rows: P2 # Comment lines # They follow the P2 line. # There could be 0, 1 or more 10 4 255
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.