## Leetcode brush notes - Sword finger Offer 29. Clockwise print matrix (simple)

Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it Title Description Enter a matrix and print out each number in clockwise order from the outside to the inside. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,2,3,6,9,8,7, ...

## Queue and priority queue (Java implementation)

introduce In our daily life, there are many queuing situations, such as queuing for meals in the canteen, queuing for tickets at the ticket window, etc. the problem of meeting the first in first out characteristics of member elements can be abstracted into a queue problem (regardless of the situation that people at the end of the queue or in t ...

## Summary of linked list sorting algorithm

Summary of linked list sorting algorithm summary Problem Description: given a linked list, please arrange the linked list in ascending order. Node definition: struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; 1. Linked list insertion sorting Title Description: Leetcode 0147 insert an ...

## Eight sorting algorithms

Performance comparison table Sorting algorithmAverage situationBest caseWorst case scenarioAuxiliary spacestabilityBubble sortingO(n^2)O(n)O(n^2)O(1)stableSelect sortO(n^2)O(n^2)O(n^2)O(1)stableInsert sortO(n^2)O(n)O(n^2)O(1)stableShell Sort Depending on incremental sequenceO(n)O(n^2)O(1)instableMerge sortO(nlogn)O(nlogn)O(nlogn)O(n)stable ...

## October 24, 2021 (weekly summary)

This week, I mainly brush some dp questions. Finally, if I want to brush according to the topic, I'll start with the backpack. Today, I don't see the question for the first time. I solved a backpack question in the provincial competition last year. I'm still very excited. At least I didn't learn in vain. It's still very useful to brush t ...

## Topic 1 ranking 2 training 3 constructing an array

Ranking There are n people in a line, and Xiao Ming is among them. He doesn't know his exact ranking, but what he can be sure of is that there are no less than a people in front of him and no more than b people behind him. How many possibilities are there for his specific ranking? Input format The first row contains the integer T, indicatin ...

## [hash] [bisection] [suffix array] Life Forms POJ3294

You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resemblance; these typically have geometric or amorphous shapes like cubes, oil slicks or clouds of dust. The answer is given in the 146th episode of Star ...

## [SHA224 of security algorithm] C language source code implementation of SHA224 abstract operation

summary As we all know, the summary algorithm is also a particularly important existence in the field of security, and SHA224 is a common summary algorithm among them. Its characteristic is that the computational complexity is low, and the equal length summary value can be obtained by inputting the original text of unequal length data, whi ...

## October 22, 2021 -- 21-22-1 blue bridge training 3

2021.10.22 – 21-22-1 blue bridge training 3 Title: Question 1: the data is out of the pot (write code according to the data) Questions 2 ~ 4: grammar questions Question 5: interval dp Question 6: kmp finding the minimum number of cyclic nodes subject 1,Test algorithm improves the output of positive and negative triangles Solution: the d ...

## [Data Structure and Algorithms] The Horseback Checkerboard algorithm

1. Basic Introduction 1) The horse-pedal chessboard algorithm is also known as the Knight Tour problem 2) Randomly place the horse at 8 in chess × 8 In a square of the board Board[0~7] [0~7], the horse moves according to the rules of chess (walking Japanese). Require each square to enter only once and walk through all 64 squares on the ...