![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Data Structure and Algorithm
Basic Data Structure and Algorithm in Java. Data structure including arrays, map, set, queue, stack, graphs, tree, heap, linked list.
James Bond Wu
这个作者很懒,什么都没留下…
展开
-
7. Basic data structure and algorithms in java - Merge sort
Merge sort Merge Sort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, l, m, r) is key proces原创 2020-09-07 03:02:04 · 125 阅读 · 0 评论 -
6. Basic data structure and algorithms in java - Shell sort
Shell sort Shell sort is based on the Insertion sorting algorithm, and it belongs to the group of very efficient algorithms. In general, the algorithm breaks an original set into smaller subsets and then each of those is sorted using Insertion sort. But, h原创 2020-09-07 03:01:13 · 118 阅读 · 1 评论 -
2. Basic data structure and algorithms in java - Bubble sort
Bubble sort is very easy to understand, use two for loop to sort the array, and the time complexity is O(n2). Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. public class Stu原创 2020-09-07 03:00:15 · 86 阅读 · 0 评论 -
3. Basic data structure and algorithms in java -Stability in sorting algorithms
What is stable sorting algorithm? A sorting algorithm is said to be stable if two objects with equal keys appear in the same order in the sorted output as they appear in the unsorted input. Whereas a sorting algorithm is said to be unstable if there are tw原创 2020-09-06 16:50:28 · 105 阅读 · 0 评论 -
4. Basic data structure and algorithms in java -Selection sort
Selection sort The selection sort algorithm sorts an array by repeatedly finding the maximum element (considering ascending order) from unsorted part and putting it at the end. The algorithm maintains two subarrays in a given array. The subarray which is原创 2020-09-06 16:49:24 · 95 阅读 · 0 评论 -
5. Basic data structure and algorithms in java -Insertion sort
Insertion sort Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the corr原创 2020-09-06 16:47:43 · 103 阅读 · 0 评论 -
1. Basic data structure and algorithms in java - Big O Notation
public class Study { // what is the kinds of algorithm // O(1) : Constant // O(logn) : Logarithmic // O(n) : Linear // O(nlogn) : nlog-star n // O(n2) : Quadratic }原创 2020-09-06 16:46:31 · 92 阅读 · 0 评论