上一页 1 ··· 5 6 7 8 9 10 11 下一页

2019年2月22日

14. Longest Common Prefix(最长公共前缀)(leetcode)

摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文

posted @ 2019-02-22 09:47 shaer 阅读(131) 评论(0) 推荐(0) 编辑

2019年2月21日

13. Roman to Integer(罗马数字转换成数字)(leetcode)

摘要: 题目: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two on 阅读全文

posted @ 2019-02-21 16:14 shaer 阅读(127) 评论(0) 推荐(0) 编辑

9. Palindrome Number(回文数)(leetcode)

摘要: Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 3: 阅读全文

posted @ 2019-02-21 14:18 shaer 阅读(168) 评论(0) 推荐(0) 编辑

2019年2月20日

Reverse Integer(反转整数)(leetcode)

摘要: 题目: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note: Assume we are dealing with an environment whic 阅读全文

posted @ 2019-02-20 22:07 shaer 阅读(293) 评论(0) 推荐(0) 编辑

顺时针打印矩阵 (剑指offer)

摘要: 题目: 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下4 X 4矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10. 代码: 时间复杂度: 阅读全文

posted @ 2019-02-20 17:55 shaer 阅读(98) 评论(0) 推荐(0) 编辑

2019年2月19日

2. Add Two Numbers(Leetcode)

摘要: 题目: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes co 阅读全文

posted @ 2019-02-19 10:49 shaer 阅读(114) 评论(0) 推荐(0) 编辑

二叉树的镜像 (剑指offer)

摘要: 注意:写代码前首先要考虑鲁棒性。 复杂问题画图分析。 运行时间:27ms 时间复杂度:o(n) 阅读全文

posted @ 2019-02-19 09:15 shaer 阅读(111) 评论(0) 推荐(0) 编辑

2019年2月18日

1. Two Sum(两个数求和)(leetcode)

摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文

posted @ 2019-02-18 19:34 shaer 阅读(415) 评论(0) 推荐(0) 编辑

树的子结构 (剑指offer)

摘要: 1、做树有关的题多数用递归 2、记得检查空指针异常 阅读全文

posted @ 2019-02-18 10:59 shaer 阅读(159) 评论(0) 推荐(0) 编辑

2019年2月3日

合并两个排序的链表 (剑指offer)

摘要: 输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。 思路:刚开始没想到递归,用递归很方便。 阅读全文

posted @ 2019-02-03 14:56 shaer 阅读(100) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 下一页

导航