- 博客(7)
- 资源 (5)
- 收藏
- 关注
原创 堆,优先队列
用最大堆实现排序 #include // Myself 15-9-26 #include using namespace std; void Adjust_Heap(int* a,int i,int n) { // 调整最大堆 if (i > n/2) return ; // 叶子节点 无需调整 int le = i<<1; int ri = i<<1|1; i
2015-09-26 19:54:26 282
原创 kinds of sort
各种排序算法 #include #include #include using namespace std; void change(int *a,int *b) /// change { int t=*a; *a=*b; *b=t; } void print(int *a,int n) /// print { for(int i=0;i<n;i++)
2015-09-23 22:41:35 375
原创 leetcode-107-Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For e
2015-09-23 18:36:06 369
原创 leetcode-102-Binary Tree Level Order Traversal
Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,
2015-09-22 20:16:08 316
原创 leetcode-101-Symmetric Tree
Symmetric Tree For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the following is not: 1 / \ 2 2 \ \ 3 3 Note: B
2015-09-21 21:13:19 305
原创 leetcode-283-Move Zeroes
Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 1
2015-09-21 13:20:51 325
原创 leetcode-110-Balanced Binary Tree
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 subt
2015-09-21 12:57:37 319
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人