Look at the animation algorithm: sorting - cardinal sorting

brief introduction In the previous article, we talked about count sorting, but count sorting has a limitation, because the count array is limited. If the range of elements in the array is too large, it is unrealistic to use count sorting, and its time complexity will expand. The way to solve the large-scale element sorting is cardinality sortin ...

Posted by Democreous on Wed, 11 May 2022 15:44:24 +0300

Test question solution on October 14 (simulation + hash + XOR + 01BFS + state pressure + expected DP)

Multiple measurements do not empty, burst two lines of tears QAQ T1 mahjong Main idea of the title: given the cards of three colors, the points of each card are $1-9 $. Specify a set of face as: 1 Three cards 2 Same color 3 The number of points is the same or increases in sequence (e.g. 555 or 678). It is now given that $n $is $13 $or $14 $, an ...

Posted by rubadub on Wed, 11 May 2022 10:19:54 +0300

Data Structures and Algorithms - Stacks and Queues

(2) Queue definition Similar to a stack, a queue is also a special linear table, and the difference from an array is also reflected in operations such as additions and deletions. The insertion operation of the queue can only be performed at the end of the queue, and the deletion operation of the queue can only be performed at the head of the ...

Posted by cobnut on Wed, 11 May 2022 07:58:00 +0300

[PyTorch learning notes] 1.2 introduction to tensor

thumbnail: https://image.zhangxiann.com/...toc: truedate: 2020/2/5 20:39:20disqusId: zhangxiancategories: PyTorch tags: AI Deep Learning Code of this chapter: https://github.com/zhangxiann/PyTorch_Practice/blob/master/lesson1/tensor_introduce1.py https://github.com/zhangxiann/PyTorch_Practice/blob/master/lesson1/tensor_introduce1.py Tensor c ...

Posted by sean14592 on Wed, 11 May 2022 06:42:57 +0300

Count the number of "reverse pairs" in an array

This article aims to record the algorithm problem of finding the inverse logarithm, but it involves another Leetcode algorithm problem of finding the inverse number, so the first part is the LeetCode [315] previously written, and the second part is the problem of finding the inverse pair number. (the second part is actually modified from the fi ...

Posted by nickiehow on Tue, 10 May 2022 23:36:25 +0300

LeetCode question brushing notes (Java) -- updated to 402 questions

preface Questions that need to open vip will be skipped temporarily Note navigation Click the link to jump to the navigation link of all brush notes 401. Binary Watch The top of the binary watch has 4 LEDs representing hours (0-11) and the bottom 6 LEDs representing minutes (0-59). Each LED represents a 0 or 1, with the lowest bit on ...

Posted by CodeMama on Tue, 10 May 2022 15:53:22 +0300

Dynamic programming & explanation of the idea of divide and rule (taking leetcode question 53: finding the maximum subsequence as an example) (transferred from the explanation of leader liwei1419 in the comment area)

Write in front: this blog is only for my summary and notes, not for any commercial purpose. If there is any infringement, please contact me to delete it. Thank you. (see the end for reprint link) Method 1: violent solution (understand, friends who are not interested can skip directly) Enumerate all subintervals: Use double-layer loop to enum ...

Posted by anna_cm on Mon, 09 May 2022 20:47:58 +0300

Graduation project --- news classification system

brief introduction News classification is a popular topic in the algorithm graduation project. In essence, it belongs to natural language classification. It can be processed by machine learning algorithm or deep learning algorithm The basic steps are as follows: Text data collection -- > select training algorithm (machine learning / deep le ...

Posted by Saeven on Mon, 09 May 2022 04:23:00 +0300

Simple calculator (implemented in C language)

A simple calculator Title Requirements: Simulate the operation of a simple arithmetic unit. Assuming that the calculator can only perform addition, subtraction, multiplication and division, and the operands and results are integers, the four operators have the same priority and are calculated from left to right. Input format: Input gives a ...

Posted by Lessur on Mon, 09 May 2022 02:04:30 +0300

The three methods of queue implementation stack have all defeated 100% of users!

This article has been included in Github's little white learning algorithm series: https://github.com/vipstone/algorith We talked before Implementing a queue with two stacks Today, we are going to talk about "realizing stack with queue", which are common interview questions. Today, we are going to use a variety of methods to realize ...

Posted by jrd on Mon, 09 May 2022 01:26:00 +0300