摘要:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l
阅读全文
摘要:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
阅读全文
摘要:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路I: 选择排序 每次都比较各个list的头指针所指的val,取最小的那个。时间复杂度O(n*k)
阅读全文
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "
阅读全文