Sword finger offer: motion range of JZ66 robot

describe There is a grid of rows and cols columns on the ground. The coordinates are from [0,0] to [rows-1,cols-1]. A robot starts to move from the grid with coordinates 0,0. Each time, it can only move one grid in the left, right, upper and lower directions, but it cannot enter the grid where the sum of digits of row coordinates and column co ...

Posted by rweston002 on Sun, 26 Dec 2021 12:47:12 +0100

Data structure - Application of stack and queue II

Data structure - Application of stack and queue I Application of stack in recursion The essence of recursion is whether the original problem can be transformed into a smaller problem with the same attributes. Features of function call: the last called function ends first (LIFO).When calling a function, you need to use a stack to store: ① ...

Posted by Whear on Sat, 25 Dec 2021 06:30:03 +0100

Stack and Queue (Sequential Storage)

Because of the lack of c language library functions, when doing some arithmetic problems, when you want to call some functions of the data structure, you always have to tap them manually or look around, so I think why not summarize some commonly used functions into it. When you write down a small book, you can only use Ctrl+C,V once (doge) to i ...

Posted by vboyz on Fri, 10 Dec 2021 18:05:11 +0100

4, Notes on data structure of postgraduate entrance examination -- basic knowledge of stack and queue (understanding of stack and queue, confusing points, familiar code)

1, Refining the concept of stack and queue Both stack and queue are linear tables with limited operation, which are linear structures. The logical structure is the same.The stack is summarized as LIFO (last in, first out); The queue is summarized as FIFO (first in first out)For the stack, n different elements, the number of different permutati ...

Posted by parag on Tue, 30 Nov 2021 15:58:55 +0100

From shallow to deep, sort from heap to heap

All the code in this article is big root heap! The implementation language is Java The pictures are all from the great God, and the great God's articles also give me a lot of inspiration Heap of data structures Heap sort This video is easy to understand, from what is heap, what is heap, and then to the realization of heap sorting. It is ver ...

Posted by witham on Mon, 22 Nov 2021 21:07:41 +0100

Two classification problem routine

Binary search routine I haven't seen hydrology for a long time. Let's write an article on hydrology today... Recently, I practiced the routine of two-point search to blow a wave General outline of routine Do you know if this question is suitable for two points 1) The target is in a continuous bounded interval (even 0~MAX, this can be ach ...

Posted by mtombs on Sat, 20 Nov 2021 07:26:25 +0100

pthread Queue for thread synchronization

pthread Queue for thread synchronization Original link https://www.foxzzz.com/queue-with-thread-synchronization/ In recent days, pthread needs to be used to implement a Queue with thread synchronization function. In the process, two pits are stepped on: pthread_cond_wait() needs to be placed in pthread_mutex_lock() and pthread_mutex_unlock( ...

Posted by mrwutang on Fri, 19 Nov 2021 18:04:14 +0100

Stack and queue 6: sliding window maximum

Problem Description: Title Link: Sliding window Max Give you an integer array nums, with a sliding window of size k moving from the leftmost side of the array to the rightmost side of the array. You can only see k numbers in the sliding window. The sliding window moves only one bit to the right at a time. Returns the maximum value in the s ...

Posted by kidestranged on Mon, 08 Nov 2021 13:40:33 +0100

Queue (sequential queue, cyclic queue, chain queue) super detailed explanation

Basic knowledge of queue Queue (ADT): a linear table that is limited to inserting at one end of the table and deleting at the other end of the table. Among them, the rear is the position where the new elements enter the queue in turn, and the front is the position where the elements in the queue leave the queue in turn. In vernacular, i ...

Posted by GYK on Sun, 31 Oct 2021 19:56:00 +0100

Python implementation of double ended queue data structure and its basic method

Queue is a special linear table and a first in first out (FIFO) data structure. It only allows deletion at the front of the table and insertion at the back of the table. The end that performs the insertion operation is called the tail of the queue, the end that performs the deletion operation is called the head of the queue, and when there are ...

Posted by waskelton4 on Thu, 28 Oct 2021 03:47:15 +0200