2013年11月14日

Permutation Sequence

摘要: The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, forn= 3):"123""132""213""231""312""321"Givennandk, return thekthpermutation sequence.Not 阅读全文

posted @ 2013-11-14 20:02 waruzhi 阅读(134) 评论(0) 推荐(0) 编辑

Insertion Sort List

摘要: Sort a linked list using insertion sort.代码: 1 ListNode *insertionSortList(ListNode *head) { 2 // IMPORTANT: Please reset any member data you declared, as 3 // the same Solution instance will be reused for each test case. 4 if(!head) 5 return NULL; 6 Li... 阅读全文

posted @ 2013-11-14 11:12 waruzhi 阅读(162) 评论(0) 推荐(0) 编辑

导航