打印三角形 public class TriangleDemo { public static void main(String[] args) { for (int j = 1; j <= 5; j++) { for (int i = 5; i >= j; i--) { System.out.pr ...
分类:
编程语言 时间:
2021-06-30 18:13:09
阅读次数:
0
Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). You are ...
分类:
其他好文 时间:
2021-06-30 18:12:21
阅读次数:
0
一.Object类 1.toString 一般子类都有覆盖。默认返回:对象的 class 名称 + @ + hashCode 的十六进制字符串。 public String toString() { return getClass().getName() + "@" + Integer.toHexS ...
分类:
其他好文 时间:
2021-06-30 18:09:41
阅读次数:
0
链式与顺序结构的最大区别在于,插入或删除操作需要移动大量元素。 链表类型:单链表,循环链表,双向链表。 单链表的组成:每个数据元素内包括两个域:数据域和指针域。 单链表的创建方式有两种:一种是头插法和尾插法。 #include <stdio.h> #include <stdlib.h> typede ...
分类:
其他好文 时间:
2021-06-30 18:07:18
阅读次数:
0
20. 有效的括号](https://leetcode-cn.com/problems/valid-parentheses/) class Solution { public boolean isValid(String s) { Map<Character, Character> map = ne ...
分类:
其他好文 时间:
2021-06-30 18:02:33
阅读次数:
0
简单工厂模式 Shape.java public interface Shape { void draw(); } Circle.java public class Circle implements Shape{ @Override public void draw() { System.out. ...
分类:
编程语言 时间:
2021-06-30 18:01:11
阅读次数:
0
布尔逻辑运算符:返回一个boolean结果 有:! 非、& 与、| 或、^异或 、&&短路与、 || 短路或 短路与:左边为false,右边就不执行 短路或:左边为true,右边就不执行 public static void main(String[] args) { int i = 10; int ...
分类:
编程语言 时间:
2021-06-30 17:59:18
阅读次数:
0
?常见基本排序 选择排序 ? 基本思路:从第一位开始标记,每次选出最小数字与标记位交换 代码实现: private static void selectSort(int[] arr) { if(arr == null || arr.length < 2){ return; } for (int i ...
分类:
编程语言 时间:
2021-06-30 17:58:34
阅读次数:
0
总述:任何集合内部都可以存储其它任何集合 1、List嵌套List public class Test{ public static void main(String[] args){ /* 假如有两个班的学生姓名,它们分别存储在两个集合中: */ //第一个班 ArrayList<String> ...
分类:
其他好文 时间:
2021-06-30 17:53:01
阅读次数:
0
@(Thread) 1.什么是进程?什么是线程? 进程是一个应用程序/软件 线程是一个进程中的执行单元/执行场景 一个进程可以启动多个线程 线程之间内存独立不共享 进程之间堆内存和方法区内存共享,栈内存独立 2.对于单核的CPU来说,实际上不存在多线程并发,而是多个线程切换的很快,让人有种并发的错觉 ...
分类:
编程语言 时间:
2021-06-30 17:39:41
阅读次数:
0