MY PRIVATE ARCADY
  • Home
  • Archives
  • Categories
  • Tags
  • About
  • Links
  •   
  •   

Use RPN(Reverse Polish Notation) to implement calculator

RPN(Reverse Polish Notation): Operators follow their operands, in contrast to PN(Polish Notation). 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
2023-01-25
CS > Data Structures
#Data Structures #CS #Java

Use stack to implement a calculator

使用栈完成表达式的计算思路: 通过一个 index 值(索引),来遍历表达式 如果我们发现是一个数字, 就直接入数栈 如果发现扫描到是一个符号, 就分如下情况 3.1 如果发现当前的符号栈为 空,就直接入栈 3.2 如果符号栈有操作符,就进行比较, ​ 如果当前的操作符的优先级小于或者等于栈中的操作符, 就需要从数栈中pop出两个数,在从符号栈中pop出一个符号,进行运算,将得到
2023-01-25
CS > Data Structures
#Data Structures #CS #Java

Use arrays to implement stack

栈:先入后出(FILO-First In Last Out)的有序链表。top–bottom, pop–push。 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253//use arrays to implement stackclass ArraySta
2023-01-14
CS > Data Structures
#Data Structures #CS #Java

Use circular linked list to solve Josephus problem

[cited from wikipedia]Josephus Problem: A number of people are standing in a circle waiting to be executed. Counting begins at a specified point in the circle and proceeds around the circle in a speci
2023-01-11
CS > Data Structures
#Data Structures #CS #Java

Singly Linked List

单向链表——data+next,只能从头向后遍历,头节点(head node)不存储信息。 定义结点(node)123456789101112131415161718class HeroNode { public int no; public String name; public String nickName; public HeroNode next;
2023-01-09
CS > Data Structures
#Data Structures #CS #Java

Using arrays to implement queues (JAVA)

队列(Queue):有序列表,可以用数组或链表实现。先入先出。 数组模拟普通队列front: point to the previous place of the first element. rear: point to the last element. 1234567891011121314151617181920212223242526272829303132333435363738394
2022-12-28
CS > Data Structures
#Data Structures #CS #Java

Conversion between sparse arrays and two-dimensional arrays using Java

稀疏数组(sparse array): 非线性结构。当一个数组中大部分元素为0,或者为同一个值的数组时,可以使用稀疏数组来保存该数组。第一行保存行数、列数、数据总数。 二维数组转稀疏数组思路: 遍历原始数组,得到数据总数(sum) 创建新稀疏数组’int [sum+1] [3]’ 再次遍历,将有效数据存入稀疏数组中 稀疏数组转二维数组思路: 根据稀疏数组第一行的数据,创建原始二维数组 根据稀疏
2022-12-27
CS > Data Structures
#Data Structures #CS #Java

【221102】杂感

来到都柏林也快两个月了
2022-11-02
日常 > 杂感
#日常

MySQL Workbench在使用时出现‘Could not acquire management access for administration’的错误

前几天在新电脑上安装了MySQL后,一直没有测试过功能,今天下午上pratical时才发现能连上server却无法访问administration权限。 Could not acquire management access for administration RuntimeError: Target host is configured as Windows, but seems to be
2022-09-21
CS > SQL
#CS #MySQL

My Second Test

测试密码功能,密码123456
2022-09-21
测试
#test
12

Search

Hexo Fluid