摘要:
Given a binary search tree and a node in it, find the in-order successor of that node in the BST. Note: If the given node has no in-order successor in 阅读全文
阅读排行榜
[Java in NetBeans] Lesson 16. Exceptions.
2019-01-01 03:55 by Johnson_强生仔仔, 240 阅读, 收藏,
摘要:
这个课程的参考视频和图片来自youtube。 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) Error: a type of Exception e.g File I/O; User Inp 阅读全文
[LeetCode] 788. Rotated Digits_Easy tag: **Dynamic Programming
2018-08-20 09:29 by Johnson_强生仔仔, 240 阅读, 收藏,
摘要:
基本思路建一个helper function, 然后从1-N依次判断是否为good number, 注意判断条件为没有3,4,7 的数字,并且至少有一个2,5,6,9, 否则的话数字就一样了, 比如88, 18等. Improve: 利用DP去判断, 时间和空间都能降为O(lgn) Code T: 阅读全文
[LeetCode] 605. Can Place Flowers_Easy
2018-08-17 11:27 by Johnson_强生仔仔, 240 阅读, 收藏,
摘要:
Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
[LeetCode] 112. Path Sum_Easy tag: DFS
2018-07-13 06:16 by Johnson_强生仔仔, 240 阅读, 收藏,
摘要:
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. N 阅读全文
浙公网安备 33010602011771号