Java学习笔记
宏观量子
这个作者很懒,什么都没留下…
展开
-
java栈,获取最小值GetMin方法。要求时间复杂度为O(1)
java栈,获取最小值GetMin方法。要求时间复杂度为O(1)import java.util.Stack;public class MINSTACK { private Stack<Integer> mainStark=new Stack<Integer>(); private Stack<Integer> minStark=new Stack<Integer>(); /** * 入栈元素 * @para原创 2021-08-13 17:20:43 · 409 阅读 · 0 评论 -
JAVA判断链表是否有环,入环节点,环长
JAVA判断链表是否有环,入环节点,环长public class Node_test { /** * 判断入环节点 */ public static Node detectCycle(Node head) { Node p1 =head; Node p2 =head; while(p2!=null&&p2.next!=null){ p1=p1.next;原创 2021-08-13 16:16:25 · 190 阅读 · 0 评论 -
CSP认证考试20206-2稀疏向量
CSP试题稀疏向量-60分long无法接受第7-10测试点,10亿数据炸内存了。标准输入无法接收import java.util.Scanner;public class p20206_2 { public static void main(String[] args) { Scanner scanner1 = new Scanner(System.in); int Num1 = scanner1.nextInt();// 数组长度 int Fnuma = scanner1.原创 2020-08-17 21:13:17 · 415 阅读 · 1 评论 -
CSP认证考试20206-1线性分类器 java语言 100分
Main方法中新建三个数组接收参数 public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int arr[]=new int[2];//接收点和查询个数 for (int i = 0; i < arr.length; i++) { arr[i]=scanner.nextInt(); } .原创 2020-08-15 19:13:53 · 355 阅读 · 0 评论 -
MySql多表查询,子查询
大数据学习笔记——MySql练习#1#查询“李新”老师所授课程的课程名称select distinct course.cnamefrom teacher,teaching,sc,coursewhere teacher.Tno = teaching.tno and teaching.cno = sc.cno and sc.cno = course.cno and sc.degree>0 and teacher.Tname = '李新' ;#2#查询女教师所授原创 2020-06-06 21:51:12 · 10193 阅读 · 0 评论 -
Java多线程与线程安全 JDK5.0新增Lock
Java多线程与线程安全利用多线程创建个3售票窗口为例1.继承于thread类来创建多线程public class Threadway extends Thread{ private static int ticket =100; public static void main(String[] args) { Threadway threadway = n...原创 2020-04-07 16:27:29 · 352 阅读 · 0 评论