最近在准备找工作的算法题,刷刷LeetCode,以下是我的解题报告索引,每一题几乎都有详细的说明,供各位码农参考。根据我自己做的进度持续更新中...... 本文地址 LeetCode:Reverse Words ...
Sort List Sort a linked list in O n log n time using constant space complexity. 使用Merge Sort, 空间复杂度是 O logN 因为使用了栈空间。 SOLUTION : 使用Merge Sort来解决问题。 为什么不用QuickSort 因为随机访问对于链表而言太耗时,而heap sort不可行。 注意,Fin ...
2014-11-29 20:55 4 3117 推荐指数:
最近在准备找工作的算法题,刷刷LeetCode,以下是我的解题报告索引,每一题几乎都有详细的说明,供各位码农参考。根据我自己做的进度持续更新中...... 本文地址 LeetCode:Reverse Words ...
Subsets Given a set of distinct integers, S, return all possible subsets. Note: Elements in a ...
LeetCode 1 Two Sum 解题报告 偶然间听见leetcode这个平台,这里面题量也不是很多200多题,打算平时有空在研究生期间就刷完,跟跟多的练习算法的人进行交流思想,一定的ACM算法积累可以对以后在对算法中优化带来好处。Ok,今天是我做的第一题Add Two Sum。 题目要求 ...
Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be construc ...
Min Stack My Submissions Question Solution Design a stack that supports push, pop, top, an ...
Permutations II Given a collection of numbers that might contain duplicates, return all possible un ...
Distinct Subsequences Given a string S and a string T, count the number of distinct subsequences of ...
Wildcard MatchingImplement wildcard pattern matching with support for '?' and '*'.'?' Matches any si ...