随笔分类 -  CC150

cc150 50道高频
2.2 Kth element linked list
摘要:ProblemImplement an algorithm to find the kth to last element of a singly linked list.Solution 1 public static ListNode findElement(ListNode head, int... 阅读全文

posted @ 2014-11-22 10:10 SuperBo 阅读(242) 评论(0) 推荐(0)

1.8 Is Rotation
摘要:Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is ... 阅读全文

posted @ 2014-11-21 14:07 SuperBo 阅读(175) 评论(0) 推荐(0)

1.7 Matrix Zero
摘要:Write an algorithm such that if an element in an MxN matrix is 0, itsentire rowand column are set to 0. 1 public static void matrixZero(int[][] matrix... 阅读全文

posted @ 2014-11-21 13:42 SuperBo 阅读(255) 评论(0) 推荐(0)

1.6 Image Rotation
摘要:Given an image represented by an NxN matrix, where each pixel in the image is4 bytes, write a method to rotate the image by 90 degrees. Can you do thi... 阅读全文

posted @ 2014-11-21 12:57 SuperBo 阅读(182) 评论(0) 推荐(0)