摘要:
问题描述: Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1- 阅读全文
摘要:
算法分析:很显然用递归。但是直接用递归会造成栈溢出,时间复杂度是o(n)。所以要用分治思想,时间复杂度是o(logN)。 阅读全文
摘要:
问题描述:给定一个字符串数组,返回变形词组,变形词是指字母一样但顺序不一样的词。 Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", " 阅读全文