Interview Practice 05 - K Smallest Elements in List

Question 输入n个整数,输出其中最小的k个。 例如输入1,2,3,4,5,6,7和8这8个数字, 则最小的4个数字为1,2,3和4。 Sample Code [expand title=”Sample Code in C++” tag=”h4″] include using namespace std; class MinK { private: int array; int size; void shiftDown(int ret,int pos,int length) { int t=ret[pos]; for(int s=2pos+…

Interview Practice 01 - Convert Binary Tree into Doubly Linked List

Question Convert binary search tree into doubly linked list. It’s required not to create any new node, but only turning pointers. Solution The following shows the concept of this question. 8 / 6 0 -> 5 = 6 = 7 = 8 = 9 = 0 = 1 / / 5 7 9 1 First, since node…

Google Plus for Android

As a new social service provided by Google, making it works on android is a must. However, this app is only available in US market. For those who loves social, try it and you will love it! Download Apk (1.0.5) Desctiption: Google+ (Google Plus) is a recent released…