![]() |
|
#1
|
|||
|
|||
qeues, stacks, listsi have a project right now.. and i don't know how to do it.. it says that i will qeues, stacks, list, or whatever it is...
but here is a little bit of the code.. CPP / C++ / C Code:
CPP / C++ / C Code:
question: 1. how can i make a database using stack, list, or qeues?? pls. help me anyone... thanks... Last edited by LuciWiz : 02-Aug-2005 at 01:18.
Reason: Changed title
|
|||
|
#2
|
||||
|
||||
|
You haven't given enough information, and your questions are too general for me to form a good answer. Perhaps you should research the assignment a little better, then come up with questions regarding specific problems so that we can help you to the best of our abilities
What I can help you on is the cin statements. You need to store the data from the keyboard into a variable of some type. If you're storing a name, you should use a string type for the variable used with cin. A proper cin statement might look like this in your program: CPP / C++ / C Code:
__________________
-Aaron |
|
#3
|
||||
|
||||
|
Quote:
If you must use one of these, your instructor obviously explained them. Use that explanation in your description of what you want to accomplish. You must have some ideas. __________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#4
|
||||
|
||||
My suggestion whould be to implement a stack by list.Quote:
try this : CPP / C++ / C Code:
Try to continue from here on your own. Don't forget to allocate memory for char* type variables ... |
|
#5
|
|||
|
|||
|
I'm new here, so correct me if I am wrong (I'm sure you will).
Stacks, Queues, Trees, are all forms of Linked Lists, including a Linear Linked List and Circular Linked List. What makes them different is how the data is structurally linked and accessible within the list. A Stack is a linked list where the last node in, is the first node out (LIFO), similar to a stack of dishes (dinner plates). A Queue, is similar to standing in line at the DMV, first node in, first node out, or pop (FIFO). A Tree, I'm not very good with this one, but the nodes branch out from a root node, like an inverse tree and each child node is known as a leaf of the list. A linear linked list is my favorite, because it is the easiest for me to manage. Its a linear list of nodes. It has a head node and a tail node, and each node has a next pointer. The node's next pointer points to the next node, unless it the last (tail) node, which the next pointer is assigned to point to NULL. Within a linear linked list, any node is accessible, deleted or inserted. I believe, same for the next type, Circular Linked List. A Circular Linked List, is the same as a linear linked list, except the tail node's next pointer, points back to the head node. All linked lists are made from the use of "structures" and pointers. Usually with the use of next and previous pointers included as structure data members. Hope this helps explain what linked lists are. |
|
#6
|
|||
|
|||
|
to the guy who gave me a bit of code.. can u please do the whole var declaration?? and i'll do the rest.. thanks in advance.. 8-)
|
|
#7
|
||||
|
||||
I must be crazy;-)
Quote:
Can't really sleep, so I wrote you some code to give you a direction. I intentionally didn't write you the third function. Do it your self and post it here if there are any problems. CPP / C++ / C Code:
Good luck, and I recommend you buy "The C programming language" (by Brian W. Kernighan & (&) Dennis M. Ritchie. Kobi Hikri. |
|
#8
|
||||
|
||||
Please notice :I treated the insertion as a queue ! This is a mistake !
Fix this by always inserting new records at the head. Kobi Hikri. |
|
#9
|
|||
|
|||
|
here are the errors when i compiled it....
Compiling... record.cpp Code:
Last edited by LuciWiz : 11-Aug-2005 at 00:58.
|
|
#10
|
||||
|
||||
It compiles on error level 4, with zero errors, Dude.Quote:
I changed the stack to work with insertion at the head, as it was supposed to be from the beginning. This is the code, try to continue from here. If you have a problem, post a code and tell me what is wrong - I will try to help : CPP / C++ / C Code:
It compiles and runs on visual c++ 6.0 with zero errors and zero warnings . What compiler are you using ? Best regards, Kobi Hikri. |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Formatting C / C++ code | WaltP | C Programming Language | 1 | 07-Jan-2008 00:59 |
| Guidelines for posting requests for help - UPDATED! | WaltP | C++ Forum | 0 | 21-Apr-2005 03:44 |
| Problem with int mixed with char,... | leitz | C++ Forum | 17 | 07-Dec-2004 21:56 |
| Help! Some basal questions about MFC | xutingnjupt | MS Visual C++ / MFC Forum | 1 | 05-Dec-2004 04:38 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The