自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 用java代码实现一个简单的二叉树

package com.mccrea.structure.tree; /** * @author mccrea * @version 1.0 * @description: 二叉树的demo * @date 2020/9/26 15:56 */ public class BinaryTreeDemo { public static void main(String[] args) { BinaryTree binaryTree = new BinaryTree(); .

2020-09-26 21:18:15 166

原创 二分查找的Java实现

/** * @author mccrea * @version 1.0 * @description: 二分查找,给定一个顺序数组(从小到大排序)和一个数,返回该数在数组中的下标,没有则返回-1 * @date 2020/9/22 20:51 */ public class BinarySearch { public static void main(String[] args) { int[] arr = new int[] {1, 3, 5, 6, 8, 12, 1.

2020-09-22 21:04:30 67

原创 基数排序java实现

import java.util.Arrays; /** * @author mccrea * @version 1.0 * @description: 基数排序 * @date 2020/9/20 16:03 */ public class RadixSort { public static void main(String[] args) { int[] arr = new int[]{23,12,543,56,24,987}; radixSort.

2020-09-20 16:56:18 70

原创 归并排序的java实现

import java.util.Arrays; /** * @author mccrea * @version 1.0 * @description: 归并排序 * @date 2020/9/20 14:09 */ public class MergeSort { public static void main(String[] args) { int[] arr = new int[] {1,4,2,7,8,2,4,8,9,0}; mergeSort.

2020-09-20 14:43:00 50

原创 快速排序的java代码实现

import java.util.Arrays; /** * @author mccrea * @version 1.0 * @description: 快速排序(递归方法) * @date 2020/9/18 22:20 */ public class QuickSort { public static void main(String[] args) { int[] arr= new int[] {9, 3, 4, 5, 1, 3, 6, 2, 8, 4, 5, .

2020-09-18 23:35:30 87

原创 排序算法-插入排序(Java代码实现)

import java.util.Arrays; /** * @author mccrea * @version 1.0 * @description: 插入排序是指在待排序的元素中,假设前面n-1(其中n>=2)个数已经是排好顺序的, * 现将第n个数插到前面已经排好的序列中,然后找到合适自己的位置, * 使得插入第n个数的这个序列也是排好顺序的。按照此法对所有元素进行插入, * 直到整个序列排为有序的过程,称为插入排序 * @date 2020/9/16 23:28 */ pu.

2020-09-17 00:06:15 176

原创 排序算法-选择排序(Java代码实现)

import java.util.Arrays; /** * @author mccrea * @version 1.0 * @description: 选择排序,第一次从待排序的数据元素中选出最小(或最大)的一个元素, * 存放在序列的起始位置,然后再从剩余的未排序元素中寻找到最小(大)元素, * 然后放到已排序的序列的末尾。以此类推,直到全部待排序的数据元素的个数为零。 * @date 2020/9/16 21:51 */ public class SelectSort { p.

2020-09-16 22:09:48 114

原创 排序算法-冒泡排序(Java代码实现)

import java.util.Arrays; /** * @author mccrea * @version 1.0 * @description: 冒泡排序{3, 12, 6, 10, 4, 1} * @date 2020/9/16 21:08 */ public class BubbleSort { public static void main(String[] args) { int[] numberArr = new int[] {3, 12, 6, 1..

2020-09-16 21:32:28 74

原创 两个有序链表合并的java实现

/** * @author mccrea * @version 1.0 * @description: 两个有序链表合并 * @date 2020/9/11 23:18 */ public class SingleListMergeDemo { public static void main(String[] args) { SingleListMerge singleListCircle = new SingleListMerge(); MergeN..

2020-09-12 21:07:26 89

原创 链表是否有环java实现

/** * @author mccrea * @version 1.0 * @description: 单链表中是否有环 * @date 2020/9/11 22:52 */ public class SingleListCircleDemo { public static void main(String[] args) { SingleListCircle singleListCircle = new SingleListCircle(); Cir...

2020-09-12 10:06:50 90

原创 单链表反转功能java实现

/** * 单链表反转 */ public class SingleListReverseDemo { public static void main(String[] args) { SingleListReverse singleListReverse = new SingleListReverse(); Node node1 = new Node(1); Node node2 = new Node(2); Node node.

2020-09-11 20:57:03 118

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除