![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Algorithms
文章平均质量分 53
u014011112
这个作者很懒,什么都没留下…
展开
-
evaluate-reverse-polish-notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another expression.Some examples:["2", "1", "+", "原创 2016-03-16 22:15:22 · 366 阅读 · 0 评论 -
binary-tree-preorder-traversal
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].public class TreeNode {原创 2016-03-16 22:25:54 · 423 阅读 · 0 评论 -
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].public class Solution {原创 2016-03-16 22:22:25 · 371 阅读 · 0 评论 -
single-number
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e原创 2016-03-16 22:32:33 · 379 阅读 · 0 评论 -
maximum-depth-of-binary-tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node./** * Definition for binary tre原创 2016-03-16 22:35:06 · 361 阅读 · 0 评论 -
快速排序(java)
实现原理:1.以最后一个关键字 K n 为枢纽,将 [K 1 ,K 2 ,…,K n ] 分成两个子区,使左区所有关键字小于等于 K n ,右区所有关键字大于等于 K n ,然后使Kn在两个子区的中间位置。此时子区内数据尚处于无序状态。 2.把左区作为一个整体,用①的步骤进行处理,右区进行相同的处理。(即递归)3.重复第①、②步,直到左区跟右区处理完毕。代码:publi原创 2016-03-27 15:35:18 · 445 阅读 · 0 评论 -
几种简单排序(java)
public class EasySort { static int[] arr = new int[] { 44, 12, 22, 3, 8, 10, 15 }; public static void main(String[] args) { display(arr); // ===================================================原创 2016-03-29 00:16:23 · 320 阅读 · 0 评论