python daily algorithm | basis of data structure: stack and queue and classic maze problem

  It's not easy to create, my guest, pay attention, collect and subscribe to one button three times ❤😜          preface Program = data structure + algorithm. Algorithm is a mixture of mathematical theory and engineering implementation. It is a very interesting and magical knowle ...

Posted by kutte on Sun, 21 Nov 2021 03:31:12 -0800

2021-09-12 algorithm Fourth Edition: 1.1.27 binomial distribution, from 10 to 10 billion

Algorithm Fourth Edition: 1.1.27 binomial distribution, from 10 to 10 billion@ TOC Recursive method to realize binomial distribution operation, O(2^N) The recursive algorithm is relatively simple. It is very suitable for small parameters. But the problem is also obvious. N * k > 100 is very slow at the beginning. When > 1000, the progr ...

Posted by Tazerenix on Sun, 21 Nov 2021 02:13:00 -0800

Leetcode 202 question: two solutions to Happy Number

Title Description Determines whether a number n is a happy number. The definition of happy number is as follows: Starting with any positive integer, replace the number by the sum of the squares of its digits. Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those ...

Posted by redrabbit on Sat, 20 Nov 2021 21:35:38 -0800

Minimum spanning tree of graph (implementation and explanation of prim algorithm and kruskal algorithm)

catalogue   1. Topic introduction   Let's start with the topic  , It is convenient to understand and reflect the algorithm more intuitively 2. Introduce my understanding of the implementation of prim algorithm code in books 1. Function of lowcast array 2. Function of adjvex array 3.kruskal algorithm 3. If you want the sou ...

Posted by rpanning on Sat, 20 Nov 2021 21:24:35 -0800

[data structure] circular snake? Leading bidirectional circular linked list of linked list

catalogue 1. Summary 2. Introduction of two-way circular linked list     2.1. Bidirectional linked list     2.2. Circular linked list     2.3. Two way circular linked list 3. Code implementation     3.1. Header file     3.2. Interface documents     3.3. Test documents 4. References 1. Summary This paper mainly introduces the concept of two ...

Posted by Svoboda on Sat, 20 Nov 2021 19:58:03 -0800

Data structure - sequential stack [c language version]

A stack is a linear table that can only be inserted or deleted at one end. (linear table with limited operation)          The stack can only insert or delete elements at the end of the table. The end of the table is the top of the stack, and the header is the bottom of the stack Main features of stack: ...

Posted by stephenf33 on Sat, 20 Nov 2021 18:11:39 -0800

Data Structure Experiment 1 (Linear Table)

1. Experimental Purpose and Requirements The main purpose of this internship is to enable students to master the basic operation of linear tables in order storage structure and chain storage structure, and to improve the analysis and problem solving ability. You are required to read and understand the following examples carefully, go throu ...

Posted by mrhinman on Sat, 20 Nov 2021 15:43:23 -0800

[HBU-DS] 7-5 tribes (and search Collection)

7-5 tribes (20 points) subject In a community, everyone has his own small circle and may belong to many different circles of friends at the same time. We think that all friends of friends are in one tribe, so please count how many disjoint tribes there are in a given community? And check whether any two people belong to the same tribe. Input ...

Posted by delorian on Sat, 20 Nov 2021 11:29:49 -0800

Data structure - Implementation of stack container

Implementation of stack Stack is an important data structure. It is a linear structure with the characteristics of last in first out Because there are two implementations of linear table, there are also two implementations of stack, namely sequential storage structure and chain storage structure. This paper gives an implementation based on cha ...

Posted by weazy on Sat, 20 Nov 2021 09:44:26 -0800

Huffman tree and Huffman coding

Huffman code Description:         Huffman coding uses the use frequency of characters to encode, and adopts the coding method of variable length, so that the frequently used character coding is shorter and the infrequently used character coding is longer;         Huffman coding has two characteristics ...

Posted by rtpmatt on Sat, 20 Nov 2021 07:00:01 -0800