• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
xiaoba1203
记录leetcode之路
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页

2016年11月1日

leetcode 118 Pascal's Triangle ----- java
摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 用的比价暴力的方法, 也是最快的。 阅读全文
posted @ 2016-11-01 21:52 xiaoba1203 阅读(164) 评论(0) 推荐(0)
 
leetcode 117 Populating Next Right Pointers in Each Node II ----- java
摘要: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti 阅读全文
posted @ 2016-11-01 21:38 xiaoba1203 阅读(274) 评论(0) 推荐(0)
 
leetcode 116 Populating Next Right Pointers in Each Node ----- java
摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2016-11-01 18:11 xiaoba1203 阅读(129) 评论(0) 推荐(0)
 
leetcode 114 Flatten Binary Tree to Linked List ----- java
摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: 这道题就是将数变为只有右节点的树。 递归,不是很难。 递归的时候求出左节 阅读全文
posted @ 2016-11-01 15:16 xiaoba1203 阅读(220) 评论(0) 推荐(0)
 
 

2016年10月29日

leetcode 113 Path Sum II ----- java
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum 阅读全文
posted @ 2016-10-29 17:54 xiaoba1203 阅读(261) 评论(0) 推荐(0)
 
leetcode 112 Path Sum ----- java
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2016-10-29 17:31 xiaoba1203 阅读(150) 评论(0) 推荐(0)
 
leetcode 111 Minimum Depth of Binary Tree ----- java
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2016-10-29 16:49 xiaoba1203 阅读(148) 评论(0) 推荐(0)
 
leetcode 110 Balanced Binary Tree ----- java
摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2016-10-29 16:39 xiaoba1203 阅读(145) 评论(0) 推荐(0)
 
leetcode 109 Convert Sorted List to Binary Search Tree ----- java
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 和上一题类似,把数组换成链表,所以可以两种做法: 1、把链表换成数组,然后用上一 阅读全文
posted @ 2016-10-29 16:18 xiaoba1203 阅读(170) 评论(0) 推荐(0)
 
 

2016年10月28日

leetcode 108 Convert Sorted Array to Binary Search Tree ----- java
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 给一个排好序的数组,然后求搜索二叉树 其实就是二分法,不难。 阅读全文
posted @ 2016-10-28 20:51 xiaoba1203 阅读(167) 评论(0) 推荐(0)
 
 
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3