随笔分类 -  数据结构入门

记录学习数据结构的点点滴滴
摘要:package ch06; public class Fibonacci { public static int getNumber(int n) { if(n == 1) { return 0; } else if(n == 2){ return 1; } else { ... 阅读全文
posted @ 2018-11-17 11:12 人工智能之路上的菜鸡 阅读(298) 评论(0) 推荐(0)
摘要:package ch03; /* * 队列类 */ public class MyQueue { // 底层实现是一个数组 private long[] arr; // 有效数据大小 private int elements; // 队头 private int front; // 队尾 private int end; ... 阅读全文
posted @ 2018-11-17 11:09 人工智能之路上的菜鸡 阅读(763) 评论(0) 推荐(0)
摘要:package ch03; public class MyStack { // 底层实现是一个数组 private long[] arr; private int top; /** * 默认的构造方法 */ public MyStack() { arr = new long[10]; top = -1... 阅读全文
posted @ 2018-11-17 11:07 人工智能之路上的菜鸡 阅读(223) 评论(0) 推荐(0)
摘要:package doublelinklist; public class Node { int item; Node pre; Node next; public Node(int item) { this.item = item; this.pre = null; this.next = null; }... 阅读全文
posted @ 2018-11-12 17:06 人工智能之路上的菜鸡 阅读(363) 评论(0) 推荐(0)
摘要:package sincyclinkedlist; public class Node { int item; Node next; public Node(int item) { this.item = item; this.next = null; } } package sincyclinkedlist; publi... 阅读全文
posted @ 2018-11-12 17:05 人工智能之路上的菜鸡 阅读(695) 评论(0) 推荐(0)
摘要:package singlelinklist; public class Node { int item; Node next; public Node(int item) { this.item = item; this.next = null; } } package singlelinklist; public cl... 阅读全文
posted @ 2018-11-12 17:03 人工智能之路上的菜鸡 阅读(808) 评论(0) 推荐(0)
摘要:package sort; import java.util.Arrays; public class SearchUtils { public static void main(String[] args) { int[] arr = { 54, 26, 93, 17, 77, 31, 44, 55, 20 }; // 二分查找要求数组有序 ... 阅读全文
posted @ 2018-11-12 15:51 人工智能之路上的菜鸡 阅读(476) 评论(0) 推荐(0)
摘要:package sort; import java.util.Arrays; public class SortUtils { public static void main(String[] args) { int[] arr = { 54, 26, 93, 17, 77, 31, 44, 55, 20 }; // bubbleSort(arr); ... 阅读全文
posted @ 2018-11-12 15:49 人工智能之路上的菜鸡 阅读(620) 评论(0) 推荐(0)