Skip to content

Commit bfec061

Browse files
authored
Merge pull request kdn251#62 from doompadee/syntax-errors
Fix syntax errors
2 parents b1aa255 + e829b35 commit bfec061

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?
22

3-
public class isUniqueChars {
3+
public class IsUniqueChars {
44
public boolean isUniqueChars(String str) {
55
int checker = 0;
66
for(int i = 0; i < str.length(); i++) {
77
int val = str.charAt(i) - 'a';
88
if((checker & (1 << val)) > 0) {
99
return false;
1010
}
11-
checker |= (1 << val));
11+
checker |= (1 << val);
1212
}
1313
return true;
1414
}
15-
}
15+
}

CrackingTheCodingInterview/Chapter3StacksAndQueues/SortStack.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public static Stack<Integer> sort(Stack<Integer> s) {
1111
while(!r.isEmpty() && r.peek() > tmp) { //step 2
1212
s.push(r.pop());
1313
}
14-
r.push(tmp) //step 3
14+
r.push(tmp); //step 3
1515
}
1616
return r;
1717
}
18-
}
18+
}

CrackingTheCodingInterview/Chapter3StacksAndQueues/TowersOfHanoi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void add(int d) {
3939
System.out.println("Error placing disk " + d);
4040
}
4141
else {
42-
disks.push(d):
42+
disks.push(d);
4343
}
4444
}
4545

@@ -56,4 +56,4 @@ public void moveDisks(int n, Tower destination, Tower buffer) {
5656
buffer.moveDisks(n - 1, destination, this);
5757
}
5858
}
59-
}
59+
}

0 commit comments

Comments
 (0)