Skip to content

Commit

Permalink
BinarySearchTree bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolrs committed Nov 17, 2020
1 parent 7c2d05a commit a98a6af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Binary file modified BSTree.class
Binary file not shown.
6 changes: 4 additions & 2 deletions BSTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,14 @@ public static void main(String[] args) {
for (int j = 0; j < n; j ++) {
tmp = br.readLine();
st = new StringTokenizer(tmp);


//pos = rank(new City(tmp, 0), whitelist);
city = mytree.get(st.nextToken());
String name = st.nextToken();
city = mytree.get(name);

if (city == null){
System.out.print("\n[Failed] " + st.nextToken() + " wasn't found.");
System.out.print("\n[Failed] " + name + " wasn't found.");
} else {
System.out.print("\n[Ok]\t" + city.toString());
}
Expand Down
4 changes: 2 additions & 2 deletions Entrada-00.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
10
a -114
Mandacaru 50
AAA -100
AAAS -140
Aarhus 162
Expand All @@ -8,5 +9,4 @@ AAU -171
ABA 44
Ababa -193
aback -148
abacus 5

abacus 5

0 comments on commit a98a6af

Please sign in to comment.