上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: Container With Most Water Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are dra 阅读全文
posted @ 2017-02-07 23:52 notesbuddy 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here a 阅读全文
posted @ 2017-02-02 23:43 notesbuddy 阅读(137) 评论(0) 推荐(0) 编辑
摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文
posted @ 2017-02-02 04:52 notesbuddy 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2017-01-31 04:26 notesbuddy 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 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 contai 阅读全文
posted @ 2017-01-31 03:31 notesbuddy 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2017-01-30 22:07 notesbuddy 阅读(128) 评论(0) 推荐(0) 编辑
摘要: tag: 二叉树 思路: 最长距离一定是两个叶子节点之间的距离 => 两个叶子节点必定以某个节点为根节点 => 因此用DFS思路自底向上计算经过每一个节点的最长距离,取其最大值 以每个节点为根节点的最长距离 = 左子树的高度+右子树的高度 阅读全文
posted @ 2017-01-26 04:43 notesbuddy 阅读(409) 评论(0) 推荐(0) 编辑
摘要: tag: 二叉树 - 完全二叉树 思路: 层次遍历二叉树,一旦某个节点没有左孩子或右孩子,则队列中接下来的节点不能有孩子。 阅读全文
posted @ 2017-01-25 23:57 notesbuddy 阅读(1329) 评论(0) 推荐(0) 编辑
摘要: tag: 二叉树 思路一: 分治 思路二:非递归??? 阅读全文
posted @ 2017-01-25 12:34 notesbuddy 阅读(273) 评论(0) 推荐(0) 编辑
摘要: tag: 二叉树 - 平衡二叉树 阅读全文
posted @ 2017-01-25 00:22 notesbuddy 阅读(217) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页