Discussion Board
There are no previous messagesThere are no next messages
Current Forum: Homework 3 Forum
Date: Fri Sep 28 2001 6:29 pm
Author: Scherer, Sebastian <basti@cmu.edu>
Subject: Test Code

Hi!
I wrote the following piece of code to test my trie:
int mark=0;
for(int i=0; i {
mark = parser.search("are",mark+1);
System.out.println("Search of are:"+mark);
}
mark = parser.search("are",mark+1);
System.out.println("Search of are:"+mark);
System.out.println("Index,count:"+mark+","+parser.count("are"));
Is it ok that he starts searching from the beginning again, after he went through all the occurences of are? I guess it sometimes happpens that there are two "are"s on one line. Last lines of output that I get:
-1
18
20
21
52
55
176
Index,count:176,376

Thank you

Sebastian
Post response

There are no previous messagesThere are no next messages
Current Thread Detail:
Test Code      Scherer, Sebastian      Fri Sep 28 2001 6:29 pm       

Back to previous screen