LeetCode – 14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. 没啥难度,不多说了 pub…
LeetCode – 9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. 这道题其实挺没意思的,不能用extra space…
LeetCode – 205. Isomorphic Strings
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the chara…
LeetCode – 73. Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow…
LintCode – Space Replacement
题目:http://www.lintcode.com/en/problem/space-replacement/ 思路: 计算空格 创建一个新的string,长度为原先长度+2*空格数 用新strin…
LeetCode – 266. Palindrome Permutation
Given a string, determine if a permutation of the string could form a palindrome. For example, “code…
LeetCode – 387. First Unique Character in a String
Given a string, find the first non-repeating character in it and return it’s index. If it does…
西部计划/目标公司/战略及用时
想去西部是从年初开始的,和创业的小伙伴们去西部过了年,虽然已经去过很多次了,但是这次让我感觉到了不同的吸引力。年中由于公司有些小变故,促进了我往前迈一步的决心。 之前一直因为房子、绿卡等等原因牵制了自…
深度优先和广度优先遍历及其 Java 实现
遍历 图的遍历,所谓遍历,即是对结点的访问。一个图有那么多个结点,如何遍历这些结点,需要特定策略,一般有两种访问策略: 深度优先遍历 广度优先遍历 深度优先 深度优先遍历,从初始访问结点出发,我们知道…
Java-Stack的三种实现(数组,容器,链表)
来源于:https://segmentfault.com/a/1190000002516799 栈(Stack)是限制仅在表的一端进行插入和删除运算的线性表。 java 没有栈这样的数据结构,如果想利…