LeetCode 498. Diagonal traversal [c++/java detailed puzzle]
1. Title
Given a matrix with M x N elements (M rows, N columns), return all the elements in the matrix in the order of diagonal traversal, as shown in the following figure.
Example:
input:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
output: [1,2,4,7,5,3,6,8,9]
Explain:
The total number of elements in a given matrix does not exce ...
Added by hurricane on Sat, 25 Dec 2021 19:12:23 +0200
❤️ "Have to see" once through the "seven sorting algorithms" ❤️
catalogue
preface
Seven sort Preview
Bubble sorting
Select sort
Insert sort
Shell Sort
Merge sort
Heap sort
Quick sort
preface
The principle of bubble sorting, selection sorting and merging sorting algorithms is reprinted. Their description and introduction are illustrated with pictures and text, which is better than my recount. Th ...
Added by jimmyhumbled on Sat, 25 Dec 2021 16:59:34 +0200
Exercise 2 - Data Lookup
subject
There is a group of numbers 12, 56, 45, 78, 90, 80, 23, 16, 8 and 63 stored in an array. Any number is received from the keyboard, and the number is searched in the array to give the information whether it is found. If found, it is required to output the position of the number in the array; If not found, output the prompt message th ...
Added by keldorn on Sat, 25 Dec 2021 09:42:49 +0200
Python - pandas module - DataFrame data structure
Python - pandas module - DataFrame data structure
pandas
Numpy is more suitable for dealing with unified numerical array datapandas is specially designed to handle tables and mixed datapanda has two data structures:
SeriesDataFrame
DataFrame
DataFrame is a tabular (similar to Excel) data structure, which contains a set of ordered co ...
Added by delfa on Sat, 25 Dec 2021 05:41:14 +0200
C language implementation of B-tree
preface
Today, we will learn another advanced data structure B tree. We know that the query time complexity of the tree is directly related to the height of the tree. When we insert a large amount of data into the red black tree, there are two problems:
(1) First of all, memory is limited and it is impossible to insert data endlessly. BST bas ...
Added by hi-liter on Sat, 25 Dec 2021 04:18:39 +0200
[Python data structure series] ☀️ Queue (sequential queue, chain queue, double ended queue) - knowledge point explanation + code implementation ☀️
Soul torture: why learn data structures? Data structure, to understand it bluntly, is to study the storage mode of data. Data storage has only one purpose, that is, to facilitate the reuse of data in the later stage. Therefore, the storage of data in computer storage space is by no means random, which requires us to choose a good way to store d ...
Added by umguy on Fri, 24 Dec 2021 21:13:25 +0200
Dynamic sequence table of data structure (including game menu)
In the previous article, we talked about the static sequence table of data structure and the implementation of static sequence table. For details, see my previous article - > > > Static sequence table of data structure.
We can know that the disadvantage of static sequence table is that because it uses fixed length array, it will waste ...
Added by chrbar on Fri, 24 Dec 2021 21:04:53 +0200
[data structure] independent path calculation
Problem description
Lao Zhang and Lao Wang love to climb mountains. They must climb Xiangshan once a week. Once, the two people had a dispute about how many paths there were from the east gate to Xianglu peak, so they agreed that who walked the route that the other party didn't walk in a period of time would win. Given a circuit diagram (undir ...
Added by nttaylor on Fri, 24 Dec 2021 20:40:25 +0200
Super hard core of data structure popular complexity, array, linked list OJ question 2W + text + picture explanation
OJ question
First, let's understand the forms of OJ questions. There are two forms:
Interface type
Provide an interface function instead of a complete program. Just implement this function. After submitting the program, this code will be submitted to the OJ server, and it will be merged with other test programs (header file and main ...
Added by maxx99 on Fri, 24 Dec 2021 16:26:44 +0200
Binary tree creation and traversal of data structure
Binary tree is a special tree data structure. This time, let's learn how to create a binary tree recursively and how to recursively traverse the binary tree. At the same time, the last preorder traversal is an example of non recursive traversal of the binary tree.
To write code, you should know well that the structure of binary tree is more co ...
Added by academ1c on Fri, 24 Dec 2021 13:34:45 +0200