摘要:
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or ... 阅读全文
摘要:
public ArrayList reverse(ArrayList list) { for(int i = 0, j = list.size() - 1; i < j; i++) { list.add(i, list.remove(j)); ... 阅读全文
摘要:
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al... 阅读全文
摘要:
Implement pow(x,n).public class Solution { public double myPow(double x, int n) { if(n == 0) return 1; if(n<0){ ... 阅读全文
摘要:
Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
摘要:
Returning null + removing operations:poll(),pollFirst().Returning null + not removing operations:peek(),peekFirst().Throwing exception + removing oper... 阅读全文
摘要:
Numbers can be regarded as product of its factors. For example,8 = 2 x 2 x 2; = 2 x 4.Write a function that takes an integernand return all possible ... 阅读全文
摘要:
Given an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the differe... 阅读全文
摘要:
Given a binary tree, return thevertical ordertraversal of its nodes' values. (ie, from top to bottom, column by column).If two nodes are in the same r... 阅读全文
摘要:
Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with ... 阅读全文