![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
atitude
时间会给你一切问题的答案。
展开
-
时间复杂度和空间复杂度
常见的大O阶1、线性阶2、平方阶3、常数阶4、对数阶案例一:案例二:案例三:原创 2022-12-01 16:17:51 · 405 阅读 · 0 评论 -
leetCode 回文串
class Solution { public boolean isPalindrome(int x) { int res = 0;//将转换成的结果初试化为res;这道题其实和取余有点像 if(x < 0) return false;//是负数的时候直接返回false; if(x>0){ int x1=x;//可以不要这个 int temp = 0; .原创 2022-04-08 16:44:16 · 296 阅读 · 1 评论 -
散列表,尚硅谷
import java.util.Scanner;public class HashTable { public static void main(String[] args) { HashTab hashTab = new HashTab(7); //写一个菜单2 String key = ""; Scanner scanner = new Scanner(System.in); while (true) {.原创 2022-03-31 17:16:33 · 704 阅读 · 0 评论 -
环形数组11
public class CircleArrayQueue { private int maxSize; private int front; private int rear; private int[] arr; //创建队列的构造器 public CircleArrayQueue(int maxSize) { this.maxSize = maxSize; arr = new int[maxSize]; .原创 2022-03-25 12:03:42 · 143 阅读 · 0 评论 -
数据结构---
public class AparseArr { public static void main(String[] args) { //创建一个二位数组 int charArr[][] = new int[11][11]; charArr[1][2] = 1; charArr[2][3] = 2; System.out.println("原始的二维数组"); for (int[] row : charA.原创 2022-03-24 20:23:55 · 922 阅读 · 0 评论 -
约瑟夫问题
package test;public class Test { public static void main(String[] args) { ListNode<Integer> first = null; ListNode<Integer> pre = null;//这里面的pre就是个工具人。 //首先我先创建循环链表 for (int i = 1; i <= 41 ; i++) { .原创 2021-11-19 16:42:23 · 195 阅读 · 0 评论 -
快慢指针,有环问题,环的入口
Node 节点:package linerList;public class Node<T> { public T data; public Node next; public Node() { } public Node(T data) { this.data = data; } public Node(T data, Node next) { this.data = data; .原创 2021-10-24 21:24:25 · 63 阅读 · 0 评论 -
实现单链表
public class Node<T> { public T item; public Node next; public Node(T item, Node next) { this.item = item; this.next = next; }}原创 2021-09-25 17:57:10 · 55 阅读 · 0 评论