java
mitchellemin
这个作者很懒,什么都没留下…
展开
-
day35
上色问题 /** * ******************************* * Unit test for depthFirstTraversal. * ******************************* */ public static void depthFirstTraversalTest() { //Test an undirected graph. int[][] tempMatri原创 2021-06-22 20:51:17 · 74 阅读 · 1 评论 -
day32
图的连通性检测package datastructure.gragh;import matrix.IntMatrix;/** * ****************************************** *Directed graph. Note that undirected graphs are a special case of directed * graphs. * * @author Michelle Min [email protected] * @d原创 2021-06-19 22:21:35 · 88 阅读 · 1 评论 -
day28
package datastructure.tree;import java.nio.charset.StandardCharsets;import java.nio.file.Files;import java.nio.file.Paths;import java.util.Arrays;import java.util.stream.Collectors;/** * ****************************************** * Huffman tree,.原创 2021-06-15 18:01:32 · 39 阅读 · 0 评论 -
day27
hanoi问题package datastructure.tree;/** * ****************************************** *Hanoi tower. * * @author Michelle Min [email protected] * @date 2021-06-14 * ****************************************** */public class Hanoi { /**2021-06-14 21:53:37 · 75 阅读 · 0 评论 -
day26
前序及后序public void PreOrderVisitWithStack(){ ObjectStack tempStack = new ObjectStack(); BinaryCharTree tempNode = this; while (!tempStack.isEmpty() || tempNode != null){ if (tempNode != null){ System.out.println("" + tempNode.value + " ");原创 2021-06-14 21:49:46 · 57 阅读 · 1 评论 -
day25
对象栈package datastructure.stack;/** * ****************************************** *Circle int queue. * * @author Michelle Min [email protected] * @date 2021-06-12 * ****************************************** */public class ObjectStack { /原创 2021-06-12 22:58:05 · 44 阅读 · 3 评论 -
day24
组建一个新二叉树 /** ***************** * The second constructor. The parameters must be correct since no validity * check is undertaken. * * @param paraDataArray The array for data. * @param paraIndicesArray The array for indices. * */ publi原创 2021-06-11 21:03:18 · 41 阅读 · 0 评论 -
day23
储存 /** * * Convert the tree to data arrays, including a char array and and an int array. * The result are stored in two member variables. * * @see #valuesArray * @see #indicesArray * */ public void toDataArraysObjectQueue(){ // Initia原创 2021-06-10 17:18:39 · 38 阅读 · 1 评论 -
day22
储存二叉树package datastructure.queue;/** * Circle Object queue. * * @author Michelle Min [email protected] */public class CircleObjectQueue { /** * The total space. One space can never be used. */ public static final int TOTAL_S原创 2021-06-09 22:11:09 · 59 阅读 · 0 评论 -
day21
二叉树package datastructure.tree;import java.util.Arrays;/** * Binary tree with char type elements. * * @author Michelle Min [email protected] * */public class BinaryCharTree { /** * The value in char. */ char value; /** * The le原创 2021-06-08 22:39:34 · 44 阅读 · 1 评论 -
day20
综合任务 面向对象与面向过程相比, 有哪些优势? 注: 第 1 - 10 天的程序, 就是面向过程的. 面向对象是一系列方法逐步运用于对象,更直观的有步骤,更符合人类逻辑。 比较线性表和链接的异同. 相似之处是都表示了某类数据之间的顺序关系。 不同的是线性表更在意的是某个数据自己的绝对位置,而不是相对位置。链表则需要一个明确的header,由header中的next才能一直找到下一个node的地址。next是一个node类型的数据,但实质上并未new一个node类型数据,而是指向某个原创 2021-06-07 15:39:20 · 49 阅读 · 0 评论 -
day19
字符串匹配package datastructure;/** * My string. String is a class provided by the language, so I use another name. * It is essentially a sequential list with char type elements. * * @author Michelle Min [email protected] * */public class MyStr2021-06-06 18:40:00 · 76 阅读 · 2 评论 -
day17
package datastructure;/** * Linked list. * * @author Michelle Min [email protected] */public class LinkedQueue { /** * An inner class. */ class Node { /** * The data. */ int data; /** * The reference to the next node....原创 2021-06-04 17:18:54 · 50 阅读 · 0 评论 -
day16
fibonacci数列package datastructure;/** * Recursion. A method can (directly or indirectly) invoke itself. The system * automatically creates a stack for it. * * @author Michelle Min [email protected] * */public class Recursion { /** * *原创 2021-06-03 21:11:17 · 57 阅读 · 2 评论 -
day15
package datastructure;import datastructure.LinkedList.Node;/** * Char stack. Do not use Stack because it is already defined in Java. * * @author Michelle Min [email protected]. */public class CharStack { /** * The depth. */ public s...原创 2021-06-02 19:51:19 · 44 阅读 · 1 评论 -
day14
栈package datastructure;/** * Char stack. Do not use Stack because it is already defined in Java. * * @author Michelle Min [email protected]. */public class CharStack { /** * The depth. */ public static final int MAX_DEPTH = 10; /**原创 2021-06-01 16:23:14 · 53 阅读 · 1 评论 -
day13
链表package datastructure;/** * Linked list. * * @author Michelle Min [email protected]. */public class LinkedList { /** * An inner class. */ class Node{ //如果内部类定义为静态,则与外部类平等,无包裹意义 //内部类非静态,则不可有main /** * The data. */ int原创 2021-05-31 21:52:36 · 52 阅读 · 4 评论 -
day12
顺序表的插值与删除 /** * * Locate the given value. If it appears in multiple positions, simply * return the first one. * * @param paraValue * The given value. * @return The position. -1 for not found. * */ public int locate(int原创 2021-05-30 20:10:32 · 61 阅读 · 5 评论 -
day11
函数 问题:1.为什么SequentialList不能改不同名字?构造函数为什么这样规定?原创 2021-05-29 19:28:40 · 68 阅读 · 11 评论 -
day10
综合测试package test;import java.util.Arrays;import java.util.Random;/** * This is the tenth code, also the first task. * * @author Michelle Min [email protected] * */public class Task1 { /** * * The entrance of the program. * *原创 2021-05-28 22:12:13 · 61 阅读 · 3 评论 -
day9
while语句的使用package test;/** * This is the ninth cod.Names and comments should follow [email protected]. * * @author [email protected] */public class WhileStatement { /** * * The entrance of the program. * * @param args *原创 2021-05-27 17:43:39 · 48 阅读 · 3 评论 -
day8
矩阵乘法package test;import java.util.Arrays;/** * This is the eighth code. Nmes and comments should follow my style strictly. * * @author Michelle */public class MatrixMultiplication { /** * * Unit test for respective method. * */ pub原创 2021-05-26 14:00:13 · 93 阅读 · 2 评论 -
day7
矩阵元素相加package test;import java.util.Arrays;public class MatrixAddition { public static void main(String args[]){ matrixElementSumTest(); matrixAdditionTest(); }//Of main public static int matrixElementSum(int[][] paraMatrix){ //在未标明i原创 2021-05-25 21:13:09 · 67 阅读 · 7 评论 -
day6
基本for语句package test;public class ForStatement { public static void main(String args[]){ forStatementTest(); }//of main public static void forStatementTest(){ int tempN = 10; System.out.println("1 add to " + tempN + " is " + addToN(tempN));原创 2021-05-24 15:24:38 · 70 阅读 · 2 评论 -
day5
基本Switch语句package test;public class SwitchStatement { public static void main(String args[]){ scoreToLevelTest(); }//Of main public static char scoreToLevel(int paraScore){ \\paraScore为虚假宣传,真正运行时带入main触发的tempScore计算 char resultLevel = 'E'原创 2021-05-23 16:29:22 · 61 阅读 · 3 评论 -
day4
进行闰年计算package test;public class LeapYear { public static void main(String args[]){ int tempYear = 2021; System.out.print("" + tempYear + " is "); if(!isLeapYear(tempYear)){ System.out.print("NOT "); }//Of if System.out.println("a leap原创 2021-05-21 21:11:51 · 131 阅读 · 2 评论 -
day3
进行if、then、else计算package test;public class Ifthenelse { public static void main(String[] args){ int tempNumber1, tempNumber2; tempNumber1 = 5; if (tempNumber1 >=0){ tempNumber2 = tempNumber1; }else{ tempNumber2 = -tempNumber1;原创 2021-05-21 11:03:25 · 350 阅读 · 0 评论 -
day2
进行基础的运算及输出package test;public class Main { //外部的任何class都能访问到,并使用这个类生成对应实例 public static void main (String args[]){ int tempFirstInt, tempSecondInt, tempResultInt; //int为32位整数类型,以二进制存储 double tempFirstDouble, tempSecondDoub原创 2021-05-20 18:18:32 · 108 阅读 · 0 评论 -
day1
1.1 package为分开不同的重名class,建立package作为包。即package作为姓氏,class类比为名字。而package间可存在附属关系,用"."来连接。例如:“java.lang.String”代表复姓“java.lang”,名字为“String”。package mitchellemin1.2 import由于package名称极易过长,编程时若将“包名.类名”写出会使代码过于冗长,于是引入import。import在java文件开头位置说明所用到类别(packag原创 2021-05-19 18:21:59 · 258 阅读 · 1 评论