Thread: Re: [Dev-C++] student needs a little help
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Benjamin W. <ben...@ho...> - 2002-02-16 03:56:57
|
<html><div style='background-color:'><P>I would agree with Jason on using a map, but then again...if the assignment is for you to develop a linked list implementation, then you need to research linked lists. You are going to want to have a good grasp of pointers before you start, so if you are rusty on pointers you need to start there.</P> <P>I used to know of a really good sight that explained several interesting data structures, including linked lists, but I cannot find the link right now.</P> <P>I did find this one, that does give some code snippets which should get you started:<BR><A href="http://www.inquiry.com/techtips/cpp_pro/10min/10min0599.asp">http://www.inquiry.com/techtips/cpp_pro/10min/10min0599.asp</A></P> <P>If you need more information, I would recommend going to <A href="http://www.google.com">http://www.google.com</A> and doing a search on linked lists. You'll be amazed at how much is actually out there.</P> <P>Hope that helps you out.</P> <DIV></DIV> <DIV><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless</FONT></DIV> <DIV></DIV> <DIV><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.</STRONG></FONT></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320</STRONG></FONT></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></DIV> <DIV> </DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>----Original Message Follows---- <DIV></DIV>From: "Jason Hardman" <JAS...@BT...> <DIV></DIV>To: "Dev-C++" <DEV...@LI...> <DIV></DIV>Subject: Re: [Dev-C++] student needs a little help <DIV></DIV>Date: Fri, 15 Feb 2002 23:16:34 -0000 <DIV></DIV> <DIV></DIV>Hi, <DIV></DIV> <DIV></DIV>List structures are usualy taught early on in a programming course you may need to tell your teacher that you haven't yet been taught lists though? You may want to clarify whether you have to make your own list data type or if you can use a standardly available one. C++ defines a standard set of container objects that should be readily available in any up to date C++ distro, called the Standard Template Library (STL), and list is one of them. I would actualy use a map (also available in the STL) to implement the grocery list though. A map is a series <KEY><VALUE>combinations, where you can look up a <VALUE>using the <KEY>part. The STL also defines a range of access and search methods for you. However you may not be allowed to rely on ready made parts, although in the real world you would. <DIV></DIV> <DIV></DIV>My best advise for you would be to arrange to talk to the teacher and ask about these things, because it would take a lot of effort to teach you about lists in a single e-mail. Books usualy have a whole chapter on them and how to use them. Try researching Algorithms and Abstract Data Types. There are probably some web-sites around that cover the subject too, anyone know any? <DIV></DIV> <DIV></DIV>Jason. <DIV></DIV>----- Original Message ----- <DIV></DIV>From: Marton Rusk <DIV></DIV>To: dev...@li... <DIV></DIV>Sent: Friday, February 15, 2002 10:23 PM <DIV></DIV>Subject: [Dev-C++] student needs a little help <DIV></DIV> <DIV></DIV> <DIV></DIV>Hello Everyone, <DIV></DIV> <DIV></DIV>I'm currently a CS Student and need a little help. I have been given the enclosed programming assignment but I'm not sure how to do it. It seems like a simple problem to solve but I don't know how to do list let and from the looks of the problem it will need one. I guess the teacher things we are supposed to know how to do list already. <DIV></DIV> <DIV></DIV>Anyhow, I'd like a few pointers on how to do this problem if possible. Maybe how to do the part of the code where it would require a list and search. <DIV></DIV> <DIV></DIV>Any help is appreciated, thanks. <DIV></DIV> <DIV></DIV>Marton <DIV></DIV> <DIV></DIV> <DIV></DIV>Program #2: Grocery Store Checkout (60 points) <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>Your assignment is to write, run, and test a C++ program, pg2, to simulate the operation of a <DIV></DIV> <DIV></DIV>grocery store checkout system. Your program should first build a data structure to contain <DIV></DIV> <DIV></DIV>information on all the products available in the store. Then the program should print the cash <DIV></DIV> <DIV></DIV>register receipt for each customer. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>INPUT <DIV></DIV> <DIV></DIV>The input for pg2 has two sources: the inventory information is input from a text file, <DIV></DIV> <DIV></DIV>and the customer transactions are input from the keyboard. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>1. The information about each product carried by the store is listed on a single line in the <DIV></DIV> <DIV></DIV>inventory file "invent.dat", in the following format: <DIV></DIV> <DIV></DIV><PRODUCT number><DESCRIPTION><PRICE><TAX> <DIV></DIV> <DIV></DIV>where <PRODUCT number>is a five-digit positive (nonzero) integer, <DESCRIPTION>is a string of <DIV></DIV> <DIV></DIV>at most 12 characters with no embedded blanks, <PRICE>is a real number, and <TAX>is a <DIV></DIV> <DIV></DIV>character ('T' if the product is taxable; 'N' if it is not taxable). The data in the inventory file is <DIV></DIV> <DIV></DIV>ordered from smallest to largest product number. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>2. The customer transactions are input from the keyboard, in the following format: <DIV></DIV> <DIV></DIV><PRODUCT number><TIMES> <DIV></DIV> <DIV></DIV>where <PRODUCT number>is as described above, and <TIMES>is an integer in the range 1 to 100, <DIV></DIV> <DIV></DIV>indicating the quantity of this product desired. A zero input for <PRODUCT number>indicates the <DIV></DIV> <DIV></DIV>end of the customer's order. (The store will soon be using a scanner to input the product number, <DIV></DIV> <DIV></DIV>but for now it is typed in by the cashier.) <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>OUTPUT <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>The program outputs should be written to a text file called "receipts.out", which can be printed <DIV></DIV> <DIV></DIV>out for purposes of determining your grade. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>1. The inventory information of invent.dat is echo printed to the output file. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>2. The cash register receipt for each customer is written to the output file. The receipts should be <DIV></DIV> <DIV></DIV>nicely formatted, with the product description (not the product number), number of items, item <DIV></DIV> <DIV></DIV>price, and total price for each product printed on a single line. At the end of each customer's <DIV></DIV> <DIV></DIV>order, the subtotal for all items, amount of tax on taxable items, and total bill should be printed, <DIV></DIV> <DIV></DIV>clearly labeled. (The tax rate is 7.5% for taxable items.) <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>PROCESSING <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>pg2 first reads in all of the inventory information from file invent.dat, echo printing the <DIV></DIV> <DIV></DIV>information to the output file receipts.out. The program then prompts the cashier to begin inputting <DIV></DIV> <DIV></DIV>the order for the first customer. This customer's order is processed, and the receipt is printed to the <DIV></DIV> <DIV></DIV>output file. <DIV></DIV> <DIV></DIV>After each customer's order is processed, the program should ask the cashier if another customer is <DIV></DIV> <DIV></DIV>to be processed. If the answer is 'Y', the program sets up to process the next customer; if the answer <DIV></DIV> <DIV></DIV>is 'N', the program terminates with a friendly message. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>ERROR CHECKING <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>The following input errors are possible and should be handled by pg2 <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>1. Duplicate <PRODUCT number>in inventory file. Write an error message to the output file and skip <DIV></DIV> <DIV></DIV>the second entry. <DIV></DIV> <DIV></DIV>2. <PRODUCT number>not in inventory file. Write an error message on the receipt, ignore that product <DIV></DIV> <DIV></DIV>number, and continue with the next item. <DIV></DIV> <DIV></DIV>3. <TIMES>not in the specified range. Write an error message to the output file, ignore that line, and <DIV></DIV> <DIV></DIV>continue with the next item. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>EXAMPLE <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>. From File "Invent.in": <DIV></DIV> <DIV></DIV>11012 gallon-milk 1.99 N <DIV></DIV> <DIV></DIV>11014 butter 2.59 N <DIV></DIV> <DIV></DIV>11110 pie-shells 0.99 N <DIV></DIV> <DIV></DIV>20115 laundry-soap 3.60 T <DIV></DIV> <DIV></DIV>30005 homestyle-br 0.99 N <DIV></DIV> <DIV></DIV>. From keyboard (one customer): <DIV></DIV> <DIV></DIV>11110 2 <DIV></DIV> <DIV></DIV>40012 3 <DIV></DIV> <DIV></DIV>20115 1 <DIV></DIV> <DIV></DIV>0 <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>. To "Receipts.out" file: <DIV></DIV> <DIV></DIV>--------------------------------------------------------- <DIV></DIV> <DIV></DIV>SEP 10, 1998 6:00 pm (* date and time optional *) <DIV></DIV> <DIV></DIV>Customer 1 <DIV></DIV> <DIV></DIV>pie-shells 2 @ 0.99 1.98 <DIV></DIV> <DIV></DIV>*** item 40012 not in inventory *** <DIV></DIV> <DIV></DIV>laundry-soap 1 @ 3.60 3.60 TX <DIV></DIV> <DIV></DIV>Subtotal 5.58 <DIV></DIV> <DIV></DIV>Tax 0.27 <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>Total 5.85 <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>DATA STRUCTURE <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>The inventory information can be stored in a list of product records. Assume that the maximum <DIV></DIV> <DIV></DIV>number of products is 50, for purposes of writing this program. As the data in the inventory file <DIV></DIV> <DIV></DIV>is ordered from smallest to largest product number, it is very simple to insert the product records <DIV></DIV> <DIV></DIV>into this data structure in order. You can use either a sequential or binary search to locate a product <DIV></DIV> <DIV></DIV>number in the inventory. <DIV></DIV> <DIV></DIV>You should specify this data structure as an ADT, as described in the chapter; define and implement <DIV></DIV> <DIV></DIV>a set of operations to encapsulate it. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>TEST PLAN <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>Be sure to include test cases to test your error conditions in your test plan. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>DELIVERABLES <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>1. A disk of the source code of the program pg2 and all included files. <DIV></DIV> <DIV></DIV>2. Hard copy of a listing of your implemented test plan. <DIV></DIV> <DIV></DIV>3. Hard copy of the output file, "receipts.out", produced by running your program using the input <DIV></DIV> <DIV></DIV>specified in your test plan. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>------------------------------------------------------------------------------ <DIV></DIV>Send and receive Hotmail on your mobile device: Click Here <DIV></DIV>_______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Join the worlds largest e-mail service with MSN Hotmail. <a href='http://go.msn.com/bql/hmtag4_etl_EN.asp'>Click Here</a><br></html> |
|
From: Benjamin W. <ben...@ho...> - 2002-02-16 13:40:14
|
<html><div style='background-color:'><DIV> <P>In my opinion, what he uses is really up to him, whether that be a container, or forcing it through with brutish, inefficient code, or using your suggestion and sticking with the data file as his container.</P> <P>The only reason that I suggested linked lists is due to the fact that he (1) is a student and his professor probably gave him the assignment in hopes that he would figure out basic data structure techniques, while at the same time showing some initiative and creativity in solving the problem and (2) because a question was posed directly concerning linked lists and where to find more information on them.</P> <P>There is nothing "wrong" with any of these approaches that have been suggested. It is really up to him and his comfort level and knowledge base that he currently has with the language. Wouldn't you agree?</P> <P><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless<BR></FONT><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.<BR></STRONG></FONT><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320<BR></STRONG></FONT><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></P></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>----Original Message Follows---- <DIV></DIV>From: "Ioannis Vranos" <NO...@YA...> <DIV></DIV>To: "Dev-C++" <DEV...@LI...> <DIV></DIV>Subject: RE: [Dev-C++] student needs a little help <DIV></DIV>Date: Sat, 16 Feb 2002 06:11:44 +0200 <DIV></DIV> <DIV></DIV>Why should he use any container at all? His "container" in the <DIV></DIV>particular case is the data file. <DIV></DIV> <DIV></DIV> <DIV></DIV>Ioannis <DIV></DIV> <DIV></DIV>* Ioannis Vranos <DIV></DIV>* Programming pages: <DIV></DIV>http://www.noicys.d2g.com <DIV></DIV>* Alternative URL: http://run.to/noicys <DIV></DIV> <DIV></DIV> <DIV></DIV>-----Original Message----- <DIV></DIV>From: dev...@li... <DIV></DIV>[mailto:dev...@li...] On Behalf Of Benjamin <DIV></DIV>Wheeless <DIV></DIV>Sent: Saturday, February 16, 2002 5:57 AM <DIV></DIV>To: dev...@li... <DIV></DIV>Subject: Re: [Dev-C++] student needs a little help <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>I would agree with Jason on using a map, but then again...if the <DIV></DIV>assignment is for you to develop a linked list implementation, then you <DIV></DIV>need to research linked lists. You are going to want to have a good <DIV></DIV>grasp of pointers before you start, so if you are rusty on pointers you <DIV></DIV>need to start there. <DIV></DIV> <DIV></DIV>I used to know of a really good sight that explained several interesting <DIV></DIV>data structures, including linked lists, but I cannot find the link <DIV></DIV>right now. <DIV></DIV> <DIV></DIV>I did find this one, that does give some code snippets which should get <DIV></DIV>you started: <DIV></DIV>http://www.inquiry.com/techtips/cpp_pro/10min/10min0599.asp <DIV></DIV> <DIV></DIV>If you need more information, I would recommend going to <DIV></DIV>http://www.google.com and doing a search on linked lists. You'll be <DIV></DIV>amazed at how much is actually out there. <DIV></DIV> <DIV></DIV>Hope that helps you out. <DIV></DIV> <DIV></DIV>Benjamin Wheeless <DIV></DIV>Network Systems - Delta Airlines, Inc. <DIV></DIV>Atlanta, GA - USA 30320 <DIV></DIV>============================== <DIV></DIV> <DIV></DIV></div><br clear=all><hr>Send and receive Hotmail on your mobile device: <a href='http://go.msn.com/bql/hmtag2_etl_EN.asp'>Click Here</a><br></html> |
|
From: Ioannis V. <no...@ya...> - 2002-02-16 16:22:11
|
I am really with short programming experience (i have been programming since 2000) and i can't understand how we can use linked lists on a large scale program. E.g. imagine we have a datafile with 10000 records. We load all of them in memory in a linked list so as to sort them on the fly e.t.c.? In few words the question is how can we apply a linked list in many records? Ioannis * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Benjamin Wheeless Sent: Saturday, February 16, 2002 3:40 PM To: dev...@li... Subject: RE: [Dev-C++] student needs a little help In my opinion, what he uses is really up to him, whether that be a container, or forcing it through with brutish, inefficient code, or using your suggestion and sticking with the data file as his container. The only reason that I suggested linked lists is due to the fact that he (1) is a student and his professor probably gave him the assignment in hopes that he would figure out basic data structure techniques, while at the same time showing some initiative and creativity in solving the problem and (2) because a question was posed directly concerning linked lists and where to find more information on them. There is nothing "wrong" with any of these approaches that have been suggested. It is really up to him and his comfort level and knowledge base that he currently has with the language. Wouldn't you agree? Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 |
|
From: Jason H. <jas...@bt...> - 2002-02-16 19:58:53
|
MessageThe trick is to tailor your method of accessing the data to the = type and quantity of data and the access speeds needed. In the store = example a few thousand records wouldn't be unreasonable, and each record = would be on average no more than 30 bytes each (roughly). Say you did = have 10000 record at 50 bytes (adding space for list implementation = etc...), that's 500,000 bytes, in other words just less than 500kb (say = half a meg). On the scale of current memory usage that's pretty = miniscule. There are cases where it's impracticle to use memory and you = have to use disk stored systems, and there are a range of specialised = algorithms for dealing with them, but on the whole most developers would = just use a Database system for large scale data storage and retrieval. = Another factor to account for is the fact that most OS's have a virtual = memory ability, so in effect if you do load a large quantity of data = into memory it will be be automaticaly placed into a disk storage = system, and it saves you a lot of complex work on disk access = algorithms. Also by ordering a list of records into a predictable sequence you allow = for the use of special searching algorithms, as aposed to the basic = sequential search. What you use is yet again dependent upon scale and = speed requirement. However there are whole volumes dedicated to this one = subject alone so I won't go into detail here. At a guess anything up to a couple of hundred megabytes is good for = memory storage (dependent upon the OS and target system in use), and = above that a more advanced data access system should be considered. Also = of note is that memory has somewhere on a scale of 1000 times quicker = access speeds than current disk technology. After saying all that a linked list wouldn't be a perfect solution = because it's not the fasted model, a tree would be more suited, but they = all follow the same principal. Searching through 10000 records in a = linked list in memory wouldn't take more than a few seconds either (at a = guess). Maybe you didn't want to know all that, but I think it's an interesting = subject. Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Saturday, February 16, 2002 4:22 PM Subject: RE: [Dev-C++] student needs a little help I am really with short programming experience (i have been programming = since 2000) and i can't understand how we can use linked lists on a = large scale program. E.g. imagine we have a datafile with 10000 records. = We load all of them in memory in a linked list so as to sort them on the = fly e.t.c.? In few words the question is how can we apply a linked list = in many records? Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... = [mailto:dev...@li...] On Behalf Of Benjamin = Wheeless Sent: Saturday, February 16, 2002 3:40 PM To: dev...@li... Subject: RE: [Dev-C++] student needs a little help In my opinion, what he uses is really up to him, whether that be a = container, or forcing it through with brutish, inefficient code, or = using your suggestion and sticking with the data file as his container. The only reason that I suggested linked lists is due to the fact = that he (1) is a student and his professor probably gave him the = assignment in hopes that he would figure out basic data structure = techniques, while at the same time showing some initiative and = creativity in solving the problem and (2) because a question was posed = directly concerning linked lists and where to find more information on = them. There is nothing "wrong" with any of these approaches that have been = suggested. It is really up to him and his comfort level and knowledge = base that he currently has with the language. Wouldn't you agree? Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 |
|
From: Ioannis V. <no...@ya...> - 2002-02-16 20:21:38
|
<http://run.to/noicys> -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jason Hardman Sent: Saturday, February 16, 2002 9:58 PM To: Dev-C++ Subject: Re: [Dev-C++] student needs a little help The trick is to tailor your method of accessing the data to the type and quantity of data and the access speeds needed. In the store example a few thousand records wouldn't be unreasonable, and each record would be on average no more than 30 bytes each (roughly). Say you did have 10000 record at 50 bytes (adding space for list implementation etc...), that's 500,000 bytes, in other words just less than 500kb (say half a meg). On the scale of current memory usage that's pretty miniscule. There are cases where it's impracticle to use memory and you have to use disk stored systems, and there are a range of specialised algorithms for dealing with them, but on the whole most developers would just use a Database system for large scale data storage and retrieval. Another factor to account for is the fact that most OS's have a virtual memory ability, so in effect if you do load a large quantity of data into memory it will be be automaticaly placed into a disk storage system, and it saves you a lot of complex work on disk access algorithms. Also by ordering a list of records into a predictable sequence you allow for the use of special searching algorithms, as aposed to the basic sequential search. What you use is yet again dependent upon scale and speed requirement. However there are whole volumes dedicated to this one subject alone so I won't go into detail here. At a guess anything up to a couple of hundred megabytes is good for memory storage (dependent upon the OS and target system in use), and above that a more advanced data access system should be considered. Also of note is that memory has somewhere on a scale of 1000 times quicker access speeds than current disk technology. After saying all that a linked list wouldn't be a perfect solution because it's not the fasted model, a tree would be more suited, but they all follow the same principal. Searching through 10000 records in a linked list in memory wouldn't take more than a few seconds either (at a guess). Maybe you didn't want to know all that, but I think it's an interesting subject. Jason. Of course i wanted to know. :) Well basically you didn't tell me anything new than those i was imagining but it's an interesting topic anyway. As for searching it depends what search you want, how the data are sorted when they are stored e.t.c.. For example if you care searching by ID and the data are stored in ID sequence, then you can implement very fast data location detection and retrieval. So we agree on small database systems we can use linked lists, e.t.c. and consider space/time trade offs. On large database systems perhaps some tricks encapsulated in the list, e.g. caching/disk retrieval combination. Thanks for sharing your opinion. Ioannis * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2002-02-16 04:11:53
|
Why should he use any container at all? His "container" in the particular case is the data file. Ioannis * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Benjamin Wheeless Sent: Saturday, February 16, 2002 5:57 AM To: dev...@li... Subject: Re: [Dev-C++] student needs a little help I would agree with Jason on using a map, but then again...if the assignment is for you to develop a linked list implementation, then you need to research linked lists. You are going to want to have a good grasp of pointers before you start, so if you are rusty on pointers you need to start there. I used to know of a really good sight that explained several interesting data structures, including linked lists, but I cannot find the link right now. I did find this one, that does give some code snippets which should get you started: http://www.inquiry.com/techtips/cpp_pro/10min/10min0599.asp If you need more information, I would recommend going to http://www.google.com and doing a search on linked lists. You'll be amazed at how much is actually out there. Hope that helps you out. Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 ============================== |
|
From: Jason H. <jas...@bt...> - 2002-02-16 13:54:29
|
MessageIt says in the specification that you should read in the data = file, and suggests a list would be the best data structure to use. If = you were modelling on real world use you would want as much data as = possible in memory to allow speedy searches. An orderd list or some = similar container type would provide a fast and flexible system for data = storage and retrieval. Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Saturday, February 16, 2002 4:11 AM Subject: RE: [Dev-C++] student needs a little help Why should he use any container at all? His "container" in the = particular case is the data file. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... = [mailto:dev...@li...] On Behalf Of Benjamin = Wheeless Sent: Saturday, February 16, 2002 5:57 AM To: dev...@li... Subject: Re: [Dev-C++] student needs a little help I would agree with Jason on using a map, but then again...if the = assignment is for you to develop a linked list implementation, then you = need to research linked lists. You are going to want to have a good = grasp of pointers before you start, so if you are rusty on pointers you = need to start there. I used to know of a really good sight that explained several = interesting data structures, including linked lists, but I cannot find = the link right now. I did find this one, that does give some code snippets which should = get you started: http://www.inquiry.com/techtips/cpp_pro/10min/10min0599.asp If you need more information, I would recommend going to = http://www.google.com and doing a search on linked lists. You'll be = amazed at how much is actually out there. Hope that helps you out. Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D |