
Java算法
R-java
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
java模拟栈结构实现四则运算
/** 用数组模拟栈结构实现计算器四则运算的中缀表达式 @author:yellowstar */ public class Calculator { public static void main(String[] args) { // TODO Auto-generated method stub //根据思路完成表达式的运算 String expression = "70+2*6-2"; //创建两个栈,一个数栈,一个符号栈 ArrayStack2 numStack = new Arr原创 2020-07-13 02:45:43 · 220 阅读 · 0 评论 -
利用栈结构实现逆波兰表达式四则运算
import java.util.ArrayList; import java.util.List; import java.util.Stack; public class PolandNotion { public static void main(String[] args) { //完成将中缀表达式转化成后缀表达式 //1+((2+3)*4)-5 ==>转成 1 2 3 + 4 * 5 - //2. 直接对str操作不方便,先将1+((2+3)*4)-5 中缀表达式对应的List //原创 2020-07-13 02:40:46 · 273 阅读 · 0 评论 -
Java实现选择排序
/* 选择排序 */ public class SelectSort { public static void main(String[] args) { // int [] arr = {101,34,119,1,-1,123,178,65,76}; int [] arr = new int[80000]; for(int i=0;i<80000;i++) { arr[i] ...原创 2020-05-06 17:13:47 · 163 阅读 · 0 评论 -
Java实现插入排序
import java.util.Arrays; /** 插入排序:将一个无序表看成一个有序表和一个无序表,排序过程就是将无序表内数据一个个取出,插入到有序表 */ public class InsertSort { public static void main(String[] args) { // int [] arr = {1,5,2,9,3,11,4,34,17}; /...原创 2020-05-06 17:11:29 · 159 阅读 · 0 评论