Data structure and algorithm

Data structure and algorithm statement:Main sources of notes data structure and algorithm[Qingdao University-Wang Zhuo],For review of data structures https://www.bilibili.com/video/BV1nJ411V7bd Chapter 1 basic concepts of data structure Section I research content of data structure Example 1 take the student management system as an ex ...

Added by zedd2006 on Tue, 02 Nov 2021 13:31:20 +0200

Data structure and algorithm-02 (queue and ring queue)

queue Application scenario and introduction Queue is a sequential list, which can be implemented by array or linked listFollow the principle of first in, first out. That is, the data stored in the queue should be taken out first, and the data stored later should be taken out laterSchematic: (use array to simulate queue schematic) [the extern ...

Added by daeken on Tue, 02 Nov 2021 02:07:09 +0200

Joseph problem of data structure and algorithm

What does Joseph's problem describe? Joseph's problem: there are N people in a circle, and each person has a number. The number is determined by the order of entering the circle. The first person entering the circle is numbered 1, and the last one is N. The number starts from the K (1 < = k < = N), and the person counting to m (1 < = ...

Added by evdawg80 on Mon, 01 Nov 2021 17:19:24 +0200

Data structure and algorithm analysis -- hash table

summary Hash table (also known as hash table) is a data structure that is accessed directly according to the key value. That is, it accesses records by mapping key values to a location in the table to speed up the search. This mapping function is called a hash function, and the array of records is called a hash table. Given table M, there ...

Added by parth on Mon, 01 Nov 2021 16:20:18 +0200

add() and remove() methods in the LinkedList source code

LinkedList underlying structure (1) The LinkedList bottom layer maintains a two-way linked list, which is an ordered set (2) LinkedList maintains two attributes, first and last, which point to the first node and the last node respectively (3) The Node object maintains three attributes: prev, next and item. Prev points to the previous Node, nex ...

Added by sirup_segar on Mon, 01 Nov 2021 09:06:11 +0200

Data structure notes - queue

1, Type definition of queue A queue is a linear table that is limited to inserting only at the end of the table and deleting only at the header. The tail of the table is called the rear, the header is called the front, and the table without elements is called an empty queue. In addition to all the characteristics of linear table, queue has it ...

Added by cybaf on Mon, 01 Nov 2021 05:47:17 +0200

Initial knowledge and basic OJ exercises of stack and queue

  this article only uses two common implementation methods - dynamic array stack and chain queue. If you want to see more implementation methods of queue and stack, you can see the section on queue and stack in my following article: Figure 5 implementation of five interfaces,    the queue and stack implementations in this articl ...

Added by deezerd on Sun, 31 Oct 2021 21:37:21 +0200

Binary tree part

tree Array, linked list and tree storage 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 you want to retrieve a specific value, or the inserted value (in a certain order) ...

Added by jsscart on Sun, 31 Oct 2021 11:32:30 +0200

Leecode elementary learning data structure -- array and string

1, Arrays and strings 1. Find the central index of the array Please calculate the central subscript of the array   The central subscript of the array is a subscript of the array. The sum of all elements on the left is equal to the sum of all elements on the right. If the central subscript is at the leftmost end of the array, the sum o ...

Added by daarius on Sun, 31 Oct 2021 04:52:12 +0200

leetcode 203. Remove linked list elements

1. Title Description: Here are the tips given in the original question: Here is the definition form of interface function and linked list given in the original question: /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* removeElements(struct L ...

Added by kansaschuck on Sat, 30 Oct 2021 07:32:20 +0300