04_JavaScript data structure and algorithm queue

JavaScript data structure and algorithm (IV) queue Cognitive queue Queue is a linear table with limited operation. Its feature is first in first out. (FIFO: First In First Out) Limitations: Deletion is only allowed at the front of the table.Insert operations are only allowed at the back end (rear) of the table. Scenes similar to queue stru ...

Posted by unknown on Sun, 28 Nov 2021 23:13:14 -0800

LeetCode-130 - surrounded area

Surrounded areaTitle Description: give you a matrix board of m x n, which consists of several characters' X 'and' O ', find all areas surrounded by' X ', and fill all' O 'in these areas with' X '.See LeetCode's official website for an example.Source: LeetCode Link: https://leetcode-cn.com/probl... The copyright belongs to Lingkou network. For ...

Posted by fireMind on Fri, 26 Nov 2021 20:00:14 -0800

2021/11/21, Swordfinger offer--Simulation

JZ29 Clockwise Print Matrix Title Address describe Enter a matrix to print out each number in clockwise order from outside to inside, for example, if you enter the following 4 X 4 matrix: [[1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16]] Print out the numbers in turn [1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10] Data Range: 0 <= matrix.len ...

Posted by kettle_drum on Sat, 20 Nov 2021 09:37:42 -0800

Java 8 array parallel sorting example | array partial sorting

On this page, we will provide an example of java 8 Arrays parallel sorting. Java 8 introduces a new method, parallelSort(), in the array class. 1. Java 8 Arrays.parallelSort() uses the sort merge algorithm to decompose the array into sub arrays, and then sort and merge them themselves. 2. The array is decomposed into subarrays, and the subar ...

Posted by Royalmike on Sat, 20 Nov 2021 05:07:08 -0800

6. Arrays and Sorting

Catalog 1. Array base 1.1. Introducing arrays Initial Value and Creation of 1.2 Array 1.3 Array Practice 2. Array Expansion 2.1 Custom Array Expansion 2.2 System-defined Array Expansion Method 3. Method encapsulation in arrays 3.1 References on Methods 3.2 Variable parameters Return value of 3.3 method returns array 4. Sorting 4.1 ...

Posted by langer on Fri, 12 Nov 2021 10:15:32 -0800

leetcode239. Maximum sliding window (difficult)

I had no idea at first... Solution 1: Violence Specifically: the outer loop traverses the left position of the window, and the inner loop traverses the elements in the window Analysis: the time complexity is O(nk) and n is the 5th power level, so it will timeout... Thinking starting point: find a data structure to maintain the elements in th ...

Posted by cnnabc on Sat, 06 Nov 2021 15:33:04 -0700

Sword finger offer array topic summary (necessary for interview)

Sword finger offer array topic summary (C + + version)   1. Duplicate number in array All numbers in an array num of length n are in the range of 0 ~ n-1. Some numbers in the array are repeated, but I don't know how many numbers are repeated, or how many times each number is repeated. Find any duplicate number in the array. Idea 1: sort first ...

Posted by j115 on Thu, 04 Nov 2021 19:06:44 -0700

c basic knowledge: detailed explanation of multidimensional array

If an array has more than one dimension, it can be called a multidimensional array. Let's take a specific look at the relevant knowledge of multidimensional arrays. 1. How to initialize multidimensional arrays int days[4][3]; As above, a two-dimensional array is defined. It can be regarded as an array of one-dimensional arrays. We can initi ...

Posted by gtibok on Thu, 28 Oct 2021 20:12:18 -0700

JavaSE02, array, reference, array copy, two-dimensional array

1. Three ways to define arrays Array: a collection that stores a set of data of the same data type public class TestDemo { public static void main(String[] args) { int[] array = {1,2,3,4,5,6,7}; // Array defined and initialization [] cannot put any numbers // matters needing attention: // 1. When defining ...

Posted by thatsme on Thu, 28 Oct 2021 16:13:25 -0700

Detailed explanation of one-dimensional array, two-bit array and string array

catalogue Array description Definition of one-dimensional array Initialization of one-dimensional array Definition of two-dimensional array Reference to two-dimensional array elements Multidimensional array Character arrays and strings Character array character string 2D string array Array description Array is one of the construc ...

Posted by kbc1 on Tue, 19 Oct 2021 13:18:35 -0700