Eight sorting algorithms implemented in Java

summary 1. Direct insertion sorting 1.1 basic idea Insert a record into the ordered table that has been sorted, so as to get a new table, and the ordered table with the number of records increased by 1 1.2 example 1.3 code implementation public static void insertSort(int [] nums){ for(int i = 1; i < nums.length; i++) ...

Posted by BostonMark on Mon, 04 Apr 2022 00:38:15 +0300

Implementation of < data structure > stack

catalogue preface        Concept of stack        Stack structure Implementation of stack        Create stack structure        Initialization stack        Destroy stack        Push        Out of stack        Get stack top element        Get the number of valid elements in the stack        Check whether the stack is empty Total code ...

Posted by Repgahroll on Sun, 03 Apr 2022 11:21:08 +0300

leetcode question 15 - sum of three numbers

I need to wait for my roommate before dinner and write down the process of solving this problem. Sum of three Post a picture first Violent solution   the violence here is reflected in two aspects: one is to find three numbers in the cycle of violence, and the other is to judge whether the current solution is already concentrated. D ...

Posted by Mikester on Sun, 03 Apr 2022 07:21:29 +0300

Sorting algorithm summary

1. Test algorithm -- logarithm public calss DataChecker{ //Generate random sample array public static int[] generateRandomArray(){ Random r = new Random(); int[] arr = new int[10000]; for(int i = 0 ; i < arr.Length ; i++){ arr[i] = r.nextInt(10000);//Generate a random number wit ...

Posted by Kibit on Sat, 02 Apr 2022 15:09:10 +0300

Daily algorithm & interview questions, 28 days of special training in large factories - the 24th day (operator)

Reading guide Fat friends, in order to better help new students adapt to algorithms and interview questions, we recently started a special assault step by step. In the last issue, we completed 21 days of dynamic programming, and now we will make a 28 day summary of various algorithms. What are you waiting for? Come and have a 28 day chal ...

Posted by cedtech31 on Sat, 02 Apr 2022 06:24:59 +0300

[data structure] C language implementation of sequential stack (sequential storage of stack through sequential table)

Principle of realizing sequence stack with sequence table Stack is a special linear table. It can only insert and delete at one end of the linear table. The end that allows insertion and deletion is called the top of the stack and the other end is called the bottom of the stack. The sequential storage of stack, namely sequential stack, refers ...

Posted by matthewlesh on Sat, 02 Apr 2022 06:23:07 +0300

The first job of windows programming

Arrays and strings 1, One dimensional array 1. Find the central index of the array Title Description: An integer array nums, write a method that can return the "central subscript" of the array The central subscript of the array is a subscript of the array. The sum of all elements on the left is equal to the sum of all elemen ...

Posted by lostincoding on Sat, 02 Apr 2022 04:22:49 +0300

[Blue Bridge real question 7] post bar team cheating? How should we prepare for the online test and the double filling trend?

⭐ Introduction ⭐ ️ Hello, I'm Zhijie. The Blue Bridge Cup will start in a week, but now it is surging. Due to the epidemic, most areas have changed to online examination. Of course, in this trend, cheating is inevitable. Even in the post bar, it is reduced to the following scenes: Of course, the official Organizing Committee of the Blue B ...

Posted by moonman89 on Sat, 02 Apr 2022 03:36:22 +0300

LeetCode's notes on writing questions: sum of two numbers (simple)

Learn algorithm, brush force buckle, refueling roll, enter the big factory! Title Description Force button title link Given an integer array nums and an integer target value target, please find the two integers with and as the target value target in the array and return their array subscripts. You can assume that each input will correspond ...

Posted by shoutdots on Sat, 02 Apr 2022 00:36:56 +0300

Basic knowledge of Java multithreading: introduction to concurrent container with source code

Introduction to concurrent container Because the synchronization container synchronizes the synchronized added by almost all methods, which ensures the safety of threads, but the cost is to seriously reduce the concurrency performance. When multiple threads compete for the container, the throughput is seriously reduced. Java5.0 began to redes ...

Posted by linkskywalker on Fri, 01 Apr 2022 23:22:15 +0300