Stacks Program

I have to write a program that reads in a sentence or phrase and also reads in a 'search string' (I'm going to have to search the sentence or phrase for the 'search string'). The search string does not have to be found exactly as you type it.

EX: I type in "This is a test string" and then "str"

when I search through the sentence for "str" it is trying to find any s, t, and r in the sentence. So it should find the first s...and then the t and r. It will also find the second s with a t and r and so on.The program has to be able to tell how much "junk" (letters that don't make up the "str") is in between the letters str, so that we can later rank them and find which match has the least "junk" in it.

I was wondering if anyone could send me in the right direction to start doing this? We have to use stacks to do this program. I know how to get the stuff into stacks and all that, I'm just not sure how to even start trying to find the 'search string' in the stacks that the sentence has been put in. If anyone has an suggestions for me it would be greatly appreciated. And if I need to explain anything more just let me know. Thanks!

[1174 byte] By [itz_just_stitcha] at [2007-11-27 9:11:41]
# 1
why don't you think about this on your own first, make an attempt and show us what you have done? You will get much more out of the exercise this way. Remember to break the problem (and your code) down into small steps which you solve one at a time.
petes1234a at 2007-7-12 21:57:28 > top of Java-index,Java Essentials,New To Java...
# 2

Well, I figured that once the sentence is put into a stack I thought that I would maybe just start popping them off one at a time and try to see if what is being popped off matches the first letter in the search string, and if it does match then I guess put it into another stack. But I don't know what to do next. Do I keep popping them into the same stack from there until I find the last letter in the search string or is there a better way to do it?

See...my problem is that I usually tend to pick up on the concepts of our assignments pretty quickly, but I have issues writing something that does what I need it to do. Kind of sucks...

itz_just_stitcha at 2007-7-12 21:57:28 > top of Java-index,Java Essentials,New To Java...