- 博客(13)
- 收藏
- 关注
原创 按法定v
#include #includeusing namespace std;void HeapAdjust(int *a,int i,int size) //调整堆 { int lchild=2*i; //i的左孩子节点序号 int rchild=2*i+1; //i的右孩子节点序号 int max=i; //临时变量
2015-02-05 11:44:40 340
原创 先成长性
#include #includeusing namespace std;void HeapAdjust(int *a,int i,int size) //调整堆 { int lchild=2*i; //i的左孩子节点序号 int rchild=2*i+1; //i的右孩子节点序号 int max=i; //临时变量
2015-02-05 11:35:15 425
原创 leetcode:Minimum Depth of Binary Tree
Minimum Depth of Binary Treehttps://oj.leetcode.com/problems/minimum-depth-of-binary-tree/
2014-10-20 15:58:24 385
原创 leetcode:Pascal's Triangle
https://oj.leetcode.com/problems/pascals-triangle/
2014-10-20 15:38:03 291
原创 leetcode:Sum Root to Leaf Numbers (二叉树的DFS)
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the tota
2014-09-24 10:06:54 347
转载 Reverse Polish Notation.逆波兰表达式,笔记
逆波兰表达式,它的语法规定,表达式必须以逆波兰表达式的方式给出。逆波兰表达式又叫做后缀表达式。这个知识点在数据结构和编译原理这两门课程中都有介绍,下面是一些例子:正常的表达式 逆波兰表达式a+b ---> a,b,+a+(b-c) ---> a,b,c,-,+a+(b-c)*d ---> a,b,c,-,d,*,+a+d*(b-c)--->a,d,b,c,-
2014-09-17 17:24:58 445
原创 leetcode:Binary Tree Level Order Traversal 【队列与二叉树y】
Binary Tree Level Order Traversal Total Accepted: 21894 Total Submissions: 70908My SubmissionsGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left t
2014-09-17 15:58:57 337
原创 leetcode【二维数组】:Triangle (最主要的算法思路)
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [
2014-09-16 11:09:13 491
原创 Leetcode【二叉树】:Binary Tree Postorder Traversal 题解(非递归解法),可以说是【二叉树】入门必须掌握
Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recursive solut
2014-09-15 17:14:27 359
原创 Leetcode【字符串】: Reverse Words in a String 要点分析
1,这是开博客的第一篇文章,也是我到北航学习的第一天,再到北京的火车上就给自己
2014-09-14 14:38:52 434
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人