Java练习题
MgZ_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
使用for循环输出杨辉三角
转载 2017-02-09 12:45:03 · 1009 阅读 · 0 评论 -
minimum-depth-of-binary-tree(深度优先遍历,广度优先遍历)
import java.util.LinkedList; /** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ /...原创 2018-07-23 13:30:17 · 299 阅读 · 0 评论 -
Satck
* 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", "+", "...原创 2018-07-23 14:13:39 · 239 阅读 · 0 评论 -
max-points-on-a-line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. /** * Definition for a point. * class Point { * int x; * int y; * Point() { x = 0...原创 2018-07-23 14:30:28 · 161 阅读 · 0 评论 -
排序算法
冒泡: for(int i=0;i<arr.length-1;i++){//外层循环控制排序趟数 for(int j=0;j<arr.length-1-i;j++){//内层循环控制每一趟排序多少次 if(arr[j]>arr[j+1]){ int temp=arr[j]; arr[j]=arr[j+1]; ...原创 2018-07-13 16:56:15 · 164 阅读 · 0 评论 -
二叉树遍历
1.左,中,右,层次遍历 package BinaryTreeTraverseTest; import java.util.LinkedList; import java.util.Queue; /** * 二叉树的深度优先遍历和广度优先遍历 * @author Fantasy * @version 1.0 2016/10/05 - 2016/10/07 */ public cl...原创 2018-07-26 15:36:54 · 162 阅读 · 0 评论 -
链表
反转链表: https://blog.youkuaiyun.com/guyuealian/article/details/51119499原创 2018-08-09 15:30:42 · 115 阅读 · 0 评论
分享