Data structure -- one-way ring linked list | Joseph problem

The origin of Joseph's problem, let's tell a little story first It is said that the famous Jewish historian Josephus had the following story: after the Romans occupied jotapat, 39 Jews hid in a cave with Josephus and his friends. 39 Jews decided that they would rather die than be caught by the enemy, so they decided a way of suicide. 41 people ...

Posted by jlambert on Wed, 19 Jan 2022 10:14:41 +0100

LeetCode-138 - copy linked list with random pointer

Copy linked list with random pointer Title Description: give you a linked list with a length of n. each node contains an additional random pointer random, which can point to any node or empty node in the linked list. Construct a deep copy of this linked list. The deep copy should consist of exactly n new nodes, in which the value of each new n ...

Posted by dman779 on Wed, 19 Jan 2022 08:26:42 +0100

Single linked list of Java data structure (with detailed drawings, easy to understand)

Single linked list of Java data structure (with detailed drawings, easy to understand) (this note mainly introduces one-way non leading node acyclic linked list) It's not easy to sum up. I hope uu you won't be stingy with your work 👍 Yo (^ u ^ ~ yo!! The linked list is a discontinuous storage structure in the physical storage structure. T ...

Posted by Masca on Wed, 19 Jan 2022 06:07:44 +0100

The most basic dynamic data structure: linked list

What is a linked list? Linked list is not only a linear structure, but also the most basic dynamic data structure. When we implement dynamic arrays, stacks and queues, the bottom layer relies on static arrays and resize s to solve the problem of fixed capacity, and the linked list is a real dynamic data structure. Learning the data structure o ...

Posted by Muggin on Wed, 19 Jan 2022 01:45:42 +0100

c + + basic STL Part 4 (queue container and list container)

A basic concept of queue container Concept: queue is a first in first out (FIFO) data structure. The queue container allows elements to be inserted from one end and removed from the other end. explain: Usually, the head of the queue is to remove data, and the tail of the queue is to insert data;There is no iterator operation in the queue, ...

Posted by afhouston on Tue, 18 Jan 2022 20:35:28 +0100

JDK1. Detailed interpretation of 7hashmap source code

(the source code analysis of this article exists in the comments of the code block. Please watch it patiently) Before we start, let's briefly understand the following HashMap. The backbone of HashMap is an entry array. Entry is the basic unit of HashMap. Each entry contains a key value pair. (in fact, the so-called Map is actually a collection ...

Posted by Redneckheaven on Tue, 18 Jan 2022 19:01:33 +0100

Hash table (general hash table, string hash and Luogu topic P1160 queue arrangement, P4387 [deep foundation 15. Xi 9] verification stack sequence)

Nanchang Institute of technology acm summer training This week I learned the hash table in the data structure and practiced some data structure topics I learned last week Next week, the multi school league will start to learn search and graph theory while making supplementary questions for the competition General hash table Definition of h ...

Posted by shezz on Tue, 18 Jan 2022 16:45:53 +0100

Stack and queue introduction and basic functions from theory to practice

Content guide 1. Stack 1.1 overview of stack 1.2 several concepts of stack 1.3 characteristics of stack 1.4 examples of stack 1.5 basic functions of stack 1.6 stack classification 1.7 implementation header file of basic functions of sequence stack 1.8 node declaration of sequential stack 1.9 basic function realization and related the ...

Posted by webtechatlantic on Tue, 18 Jan 2022 05:43:40 +0100

Learning notes of Chapter 3 of Dahua data structure -- linear table

Definition of linear table Linear table: a finite sequence of zero or more data elements. The number n of linear table elements is defined as the length of the linear table. When n is 0, it is an empty table. In a complex linear table, a data element can be composed of several data items. Storage structure of linear table Sequential storag ...

Posted by Shroder01 on Mon, 17 Jan 2022 12:07:00 +0100

Traversal of java tree

In programming life, we always meet tree structure. These days, we just need to operate the tree structure, so we can record our own operation mode and process. Now suppose there is such a tree, (it doesn't matter whether it is a binary tree or not, and the principle is the same) 1. Breadth first traversal The English abbreviation is BFS, th ...

Posted by rinjani on Mon, 17 Jan 2022 00:03:03 +0100