摘要:
第一种:Mapmap=newHashMap();Iteratoriter=map.entrySet().iterator();while(iter.hasNext()){Map.Entryentry=(Map.Entry)iter.next();Objectkey=entry.getKey();Ob... 阅读全文
摘要:
12 位运算 C语言是为描述系统设计的,因此它应该具有汇编语言所以完成的一些功能。C语言既有高级语言的特点,又具有低级语言的功能。因而具有广泛的用途和很强的生命力。12.1 位运算符和位运算运算符 含义& 按位与| 按位或^ 按位异或~ 取反> 右移说明:(1)位运算... 阅读全文
摘要:
Given 3*n + 1 numbers, every numbers occurs triple times except one, find it.ExampleGiven [1,1,2,3,3,3,2,2,4,1] return 4ChallengeOne-pass, constant ex... 阅读全文
摘要:
The structure of Segment Tree is a binary tree which each node has two attributes start and end denote an segment / interval.start and end are both in... 阅读全文
摘要:
Implement a stack with min() function, which will return the smallest number in the stack.It should support push, pop and min operation all in O(1) co... 阅读全文
摘要:
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th... 阅读全文
摘要:
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.ExampleGivenn= 3, your program should return all 5 unique B... 阅读全文
摘要:
Given n, how many structurally unique BSTs (binary search trees) that store values 1...n?ExampleGiven n = 3, there are a total of 5 unique BST's.1 ... 阅读全文
摘要:
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and ... 阅读全文
摘要:
Implement pow(x, n).NoteYou don't need to care about the precision of your answer, it's acceptable if the expected answer and your answer 's differenc... 阅读全文