Please , Can someone help me with this assignment.
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:
QUOTE
2 4 6 8 9 -1 2 3 4 5 6 7 8 9 -2 10 11 -3 2 4 6 8 9 0
This post has been edited by Dark_Nexus: 26 Sep, 2006 - 11:04 PM