![]() |
|
#1
|
|||
|
|||
Backtrack in C programming, need help pleaseHi there.
I got an assignment to complete which is totally out of my mind. I have no clue about it. I hope you will be able to give me a shade of light please. The question is as follows, Thank you. QUESTION Backtrack is one of the applications for stack data structure, in which you can trace back the steps. Write a C program that allows you to read a set of integers. Every time you read the negative integer, you must backtrack and print five integers which comes before the negative integer. Use stack data structure to solve this problem. Input/Read the integers and insert the integers into stack (without printing it) until you found the negative integer. At this point, you stop receiving/read input. Remove the five elements from the stack and print the elements. After printing the five elements, continue receiving input/read data and insert the items into the stack. When number 0 is entered, print the message of the remaining items in the stack, and stop the program. Test your program using the following data: 2 4 6 8 9 -1 2 3 4 5 6 7 8 9 -2 10 11 -3 2 4 6 8 9 0 |
|||
|
#2
|
|||
|
|||
Re: Backtrack in C programming, need help pleaseTake a look at:
math.nist.gov ...for an idea of how to implement a stack. Also, this is a C question, you may have better results by posting in the C (not the C++) forum. :davis: |
|
#3
|
|||
|
|||
Re: Backtrack in C programming, need help pleaseThank you friend for the info.
|
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help on backtrack please, in C programming | selvamd5 | C Programming Language | 6 | 09-Nov-2006 06:51 |
| A few questions for someone in the programming industry. | WAEvans | Miscellaneous Programming Forum | 0 | 08-Oct-2006 09:19 |
| printer / font color / windows programming | nicolas_qc | MS Visual C++ / MFC Forum | 0 | 03-Jan-2006 23:13 |
| [Tutorial] GUI programming with FLTK | dsmith | FLTK Forum | 10 | 03-Oct-2005 15:41 |
| GUI programming | crystalattice | C++ Forum | 5 | 14-Sep-2004 12:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The