This world need more Zhu 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5840 Description As we all know, Zhu …
Codeforces Beta Round #5 B. Center Alignment 模拟题
B. Center Alignment 题目连接: http://www.codeforces.com/contest/5/problem/B Description Almost every text editor h…
VK Cup 2016 - Qualification Round 1 (Russian-Speaking Only, for VK Cup teams) D. Running with Obstacles 贪心
D. Running with Obstacles 题目连接: http://www.codeforces.com/contest/637/problem/D Description A sportsman starts…
HDU 4027 Can you answer these queries?(线段树)
Can you answer these queries? Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 6576…
HDU 4349 Xiao Ming's Hope(数学题)
Xiao Ming’s Hope Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768…
leetcode-150. Evaluate Reverse Polish Notation
题目描述 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /…
字符串算法
字符串算法 字符串字符判重算法 字符串反转算法 字符串左旋算法 字符串右旋算法 字符串旋转匹配算法 字符串包含算法 字符串删除算法 字符串原地替换算法 字符串压缩算法 字符串变位词检测算法 字符串转整数算法 字符串全排列…
[LeetCode] Sum of Two Integers 两数之和
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example…
[LeetCode] Shortest Unsorted Continuous Subarray 最短无序连续子数组
Given an integer array, you need to find one continuous subarray that if you only sort this s…
[LeetCode] Replace Words 替换单词
In English, we have a concept called root, which can be followed by some other words to form anoth…
python实现二叉树遍历算法
说起二叉树的遍历,大学里讲的是递归算法,大多数人首先想到也是递归算法。但作为一个有理想有追求的程序员。也应该学学非递归算法实现二叉树遍历。二叉树的非递归算法需要用到辅助栈,算法着实巧妙,令人脑洞大开。 以下直入主题: 定…
红黑树:特点及如何调整
一、概述 红黑树是自平衡的二叉搜索树,是计算机科学中的一种数据结构。 平衡是指所有叶子的深度基本相同(完全相等的情况并不多见,所以只能趋向于相等) 。 二叉搜索树是指,节点最多有两个儿子,且左子树中所有节点都小于右子树。…