This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given an M*N matrix in which each row and each column is sorted in ascending order, write a method to find an element. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int findMaxDepth(Node root){ | |
if(root == null) return -1; | |
return Math.max(fidMaxDepth(root.left), findMaxDepth(root.right)) + 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Make any given string a palindrome by adding the minimum number of characters. | |
http://isharemylearning.blogspot.com/2012/08/minimum-number-of-insertions-in-string.html | |
http://blog.csdn.net/atfield/article/details/1496132 | |
http://blog.csdn.net/atfield/article/details/1496132 | |
2. power of a number (hint: recursion) | |
3. Describe the file system in hadoop in big view | |
4. If you are writing a class in Java, "Student" for example; you are storing it in a hashtable; and you want the objects are identical to the names. what can you do? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command line: | |
run.exe cat "big dog" fish the"symbol monkey | |
return: | |
1. run.exe | |
2. cat | |
3. big dog | |
4. fish | |
5. the"symbol | |
6. monkey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given a M*N matrix, if matrix[i][j] == 0, set all the elements in row i and column j to '0'. | |
When you could not use other buffer. | |
When this is a 3D matrix or nD matrix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
____ ____ | |
| |___| | | |
|__|___|___|_ | |
Several rectangles range along a line. Reruen the outline of rectangles. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find the biggest sum of a sequent integers. | |
For example: | |
[4 3 -2 1 -8 10 2 -3 -1] | |
The giggest sequence is "10 2" => 12. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given a sorted array of strings which is interepersed with empty strings, write a method to find the location of a given string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write a methos to sort an array of strings so that all the anagrams are next to each other. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are given two sorted arrays, A and B, where A has a large enough buffer at the end to hold B. Write a method to merge B into A in sorted order. | |
1 5 8 9 | |
2 6 8 10 |