CC150
文章平均质量分 72
biubiuX
这个作者很懒,什么都没留下…
展开
-
Cracking the Coding Interview Chap1 Q1.1
Q1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? Sol.1 : check every char of the string to every other char of原创 2013-10-04 11:59:04 · 902 阅读 · 0 评论 -
Cracking the Coding Interview Chap1 Q1.3
Q1.3 Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. NOTE: One or two additional variables are fine. An extra copy of the array原创 2013-10-04 12:25:23 · 585 阅读 · 0 评论 -
Cracking the Coding Interview Chap1 Q1.4
Q1.4 Write a method to decide if two strings are anagrams or not public class ccChap1_4 { public static void main(String[] args){ String s1 = "ABCDEFFG"; String s2 = "EFFGCBAD"; Syste原创 2013-10-04 12:29:37 · 487 阅读 · 0 评论 -
Cracking the Coding Interview Chap1 Q1.5
Write a method to replace all spaces in a string with ‘%20’ You can not put '%20' directly into a string, and the size of new string doesn't equal to old string. public class ccChap1_5 { pu原创 2013-10-05 13:24:08 · 520 阅读 · 0 评论