- 博客(4)
- 收藏
- 关注
原创 (JAVA)用单链表形式模拟商品通过编号进行增删改查功能
一. 定义商品类(商品节点):/*商品节点*/public class GoodsNode { private int id; private double price; private String name; public GoodsNode next; public GoodsNode(int id, double price, String name) { this.id = id; this.price = p
2021-12-05 19:18:59
251
原创 (JAVA)使用栈完成String字符串表达式计算
/*在栈中加入如下方法*//*----------------栈的表达式结果--------*/ /* * 判断是否是运算符*/ public boolean isOper(char c){ return c=='+'||c=='-'||c=='*'||c=='/'; } /*判断运算符优先级,使用数字来表示,数字越大优先级越大*/ public int priority(int oper){ if(oper=='*'|.
2021-12-05 13:30:49
248
原创 (JAVA)栈的回文数据实现
//栈的回文数据public class Text02 { public static void main(String[] args) { System.out.println(text01("aba")); } //判断回文数据的方法 public static boolean text01(String val){ //初始化栈 ArrayStack as = new ArrayStack(10); .
2021-12-04 19:12:16
428
原创 Java数据结构之栈的数组实现
//数组模拟栈public class ArrayStack { private int maxStacksize; private int[] stack; private int top = -1; public ArrayStack(int maxStacksize){ this.maxStacksize = maxStacksize; stack = new int[maxStacksize];//必须数组初始化 }.
2021-12-04 19:11:00
581
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人