C language - Joseph problem (Joseph Ring)

Joseph problem is also called Joseph Ring. Joseph problem has many variants. This paper introduces several solutions to several classical Joseph problems. Question 1: Lu Zhishen eats steamed bread. It is said that Lu Zhishen hurried to daxiangguo temple in Kaifeng at noon one day and wanted to have a meal. At that time, there were 99 monks ...

Posted by BeanoEFC on Thu, 27 Jan 2022 09:13:33 +0100

DLX learning notes

DLX \(\ text{DLX} \), dance chain, which mainly solves the problems of accurate coverage and repeated coverage. This paper only introduces the exact coverage problem for the time being. I don't know when to solve the problem of repeated coverage. 1. Template questions P4929 [template] dance chain (DLX) Meaning: Given a matrix of \ (N \) rows \ ...

Posted by NINTHTJ on Thu, 27 Jan 2022 03:11:36 +0100

Pointer to various applications [real interview questions of large factories]

Analysis of various applications of pointer and real interview questions of large factories preface Most of the pointers learned by beginners or ordinary colleges and universities are simple, that is, we understand that the pointer is an address. We can operate the address content through dereference operation, which is often limited ...

Posted by rharter on Wed, 26 Jan 2022 18:34:39 +0100

Sword finger offer (jz31--jz40) python!!

Number of occurrences of 1 in jz31 integers (from 1 to the number of occurrences of 1 in n integers) describe Enter an integer n and find the number of occurrences of 1 in the decimal representation of N integers 1 ~ n For example, the numbers 1, 10, 11, 12 and 13 containing 1 in 1 ~ 13 appear 6 times in total thinking Direct method: splice ...

Posted by johnpdmccall on Wed, 26 Jan 2022 18:15:45 +0100

Rust basic one-way linked list

Use Rust to complete one-way linked list I've been idle recently. I saw the rise of rust, a language with a considerable salary. I heard that some linux began to write with rust, but I heard that learning had a curve. At that time, I didn't believe in evil. After learning, I knew that there was a curve... The linked list alone has been done fo ...

Posted by victor78 on Wed, 26 Jan 2022 05:20:59 +0100

Weekly leetcode - NC13/NC70/NC62/NC73/NC112/NC96/NC34/62/NC57/7/NC16/NC25/237/82/NC9/NC55

simple Niuke Tiba - NC13 maximum depth of binary tree Find the maximum depth of a given binary tree. Depth refers to the number of nodes on the path from the root node of the tree to any leaf node. The maximum depth is the maximum depth of all leaf nodes. public class Solution { public int maxDepth (TreeNode root) { if(root== ...

Posted by tarlejh on Tue, 25 Jan 2022 18:37:53 +0100

Linear discrete storage linked list in data structure

In the previous section, we have learned about continuous storage in linear storage. We also call this storage structure sequential table or array. We also know that linear continuous storage has the following advantages and disadvantages: Advantages: it can quickly add and access elementsDisadvantages: inserting or deleting elements will mo ...

Posted by JustinMs66 on Tue, 25 Jan 2022 15:39:16 +0100

Day21 binary tree quick start learning (Java)

1, Why use a tree as a data structure 1) Analysis of array storage mode Advantages: it is fast to access elements by subscript. For ordered arrays, binary search can also be used to improve the retrieval speed. Disadvantages: if a specific value is to be retrieved, or the inserted value (in a certain order) will move as a whole, which is ine ...

Posted by Garth Farley on Mon, 24 Jan 2022 04:35:56 +0100

Analyze LinkedList from the design source code

I'm so tired to write this blog. In addition, it took me 6 hours to write and read the source code. It can be said that I was extremely lucky and bitter. Too tired, too tired!!! Linked list is a linear list with linked storage. The memory addresses of all elements are not necessarily continuous. Dynamic array has an obvious disadvantage ------ ...

Posted by hjunw on Mon, 24 Jan 2022 03:11:53 +0100

Whether two linked lists intersect

Given the head nodes headA and headB of two single linked lists, please find and return the starting node where the two single linked lists intersect. If two linked lists have no intersection, null is returned. Note: there may be rings in the chain structure. First, judge whether a single linked list is a ring. Given a linked list, return the ...

Posted by pchytil on Mon, 24 Jan 2022 02:13:02 +0100