摘要:ProblemImplement an algorithm to find the kth to last element of a singly linked list.Solution 1 public static ListNode findElement(ListNode head, int...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文