- 博客(12)
- 收藏
- 关注
原创 # leetcode 110. balanced Binary Tree
leetcode 110. balanced Binary Tree题目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 depth of the two sub
2017-08-28 10:50:20 231
原创 【基础知识】 binary search tree
binary search tree见Binary Search Tree主要特点:小值在左,大值在右最大值:树的最右节点。最小值:树的最左节点。某元素前驱:左子树的最右。某元素的后继:右子树的最左。
2017-08-18 10:22:07 229
原创 Python学习 ——enumerate函数
237. Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are giv
2017-08-11 12:52:19 234
原创 141 linked list cycle
linked list cycleGiven a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?用tortoise and hare算法,一个快指针一个慢指针。代码块leetcode上的最优解法:# Definition for singl
2017-08-10 15:45:25 201
原创 动态规划 139 Word Break + 322 Coin Change
动态规划总结322. Coin ChangeYou are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If
2017-07-15 11:26:55 263
原创 eric4 utf-8 问题
‘utf8’ codec can’t decode bytes in position 11558-11559: invalid continuation byte是eric设置的问题。 在菜单栏:settings\preferences\python\ 这里的python是有python图标的那个,将encoding下有string encoding 和 io encoding都设置成utf-
2017-07-06 18:35:17 342 2
原创 add 2 numbers
2. add 2 numbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbe
2017-07-05 22:36:18 182
原创 markdown范本
55. Jump Game题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Dete
2017-07-05 16:41:17 561
原创 Eric4无法生成compile form的问题
Eric4无法生成compile form的问题是项目路径中有中文的问题,将项目目录改成全英文即可。
2017-07-02 12:01:30 549
原创 动态规划——Climbing Stairs(easy,python)
动态规划——Climbing Stairs(easy,python)题目n级台阶,一次跨1级台阶或者2级台阶,问最终能到有几种到达台阶顶的方案。解析当n<=0,0种方案,不需要走 当n = 1,1种方案,走一步上去 当n = 2,2种方案,一步一步 or 一下子两步而对于第n级来说,假设n-1级,n-2级分别有 num[n-1],num[n-2], 则 n-1级到n级只能跨一级台阶,而n-2级到
2017-07-01 21:26:22 323
原创 Visual Studio Code 调试中输入问题
VS code调试控制台输入不响应可参考 https://github.com/DonJayamanne/pythonVSCode/wiki/Capture-User-Input-via-input()-or-raw_input()将配置调整至内部或外部terminal即可进行调试,不要用自带的调试控制台。如下图配置完成即可在自带的terminal中运行调试。
2017-06-30 21:25:47 3348
原创 Python学习 ——enumerate函数
enumerate函数例子list = ['a', 'b', 'c']for i,c in enumerate(list): print i,c输出结果:0 a1 b2 c序号 对应 值-沙发啊 - Markdown和扩展Markdown简洁的语法 - 代码块高亮 - 图片链接和图片上传 - LaTex数学公式 - UML序列图和流程图
2017-06-30 16:34:35 359
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人