LRU algorithm and LFU algorithm
LRU algorithm
LRU is the abbreviation of Least Recently Used, that is, the Least Recently Used algorithm. It is a page replacement algorithm in the operating system. Because the number of pages stored in memory is limited, the recently unused algorithm will be moved out of memory. LRU principle: The principle of LRU is shown in the figure belo ...
Posted by Kyori on Sun, 23 Jan 2022 17:26:43 +0100
Data structure - operation and implementation of single linked list (including all codes)
Article catalogue
catalogue Article catalogue preface 1, Basic operation 2, Code implementation 1. Code This is test Part C is mainly the part of the main function This is linklist Part C is mainly the part of the function body This is test H, mainly the header file 2. Display effect summary
preface
Recently, I learned the li ...
Posted by Karlos94 on Sun, 23 Jan 2022 04:57:50 +0100
Leetcode Brush Title Notes - Basic Operation and Classic Title of Chain List
Brush the title from: Code Casual Recording
1. Chain list basic operations
707. Design Chain List
Leetcode Link
Design the implementation of the chain table. You can choose to use single or double-linked lists. A node in a single-chain table should have two attributes: val and next. val is the value of the current node, and next is the ...
Posted by qrt123 on Sat, 22 Jan 2022 21:35:16 +0100
C language data structure - queue
1, Basic concepts of queue
(1) Definition: a linear table that can only be inserted at one end of the table and deleted at the other end of the table. (2) Features: first in first out
The schematic diagram is as follows:
2, Queue of sequential storage structure
Dynamic diagram of sequential queue with 6 storage spaces
2.1 "false ove ...
Posted by mistercoffee on Sat, 22 Jan 2022 21:14:58 +0100
Day 12 & PriorityQueue
"This is the fourth day of my participation in 2022's first update challenge. See the activity details: 2022 first update challenge」
This blog post will be released in Nuggets community first!
subject
The daily practice is changed from the original > = 5 questions to > = 3 questions. There is no way, > = 5 questions are a ...
Posted by mrjameer on Sat, 22 Jan 2022 14:18:07 +0100
On the unique methods of LinkedList
1, What is a LinkedList collection
LinkedList: the LinkedList class implements the List interface and the Collection interface. It is the link List implementation of the List interface. All elements (including null) are allowed. These operations allow a linked List to be used as a stack, queue, or double ended queue. This class provides queue ...
Posted by whizard on Sat, 22 Jan 2022 02:07:45 +0100
Explanation of Leetcode UHF questions
High frequency questions (I)
1, Reverse linked list (206)
Title Description:
Note: the more accurate expression should be that the result of inversion is 1 ⬅ two ⬅ three ⬅ four ⬅ 5. In other words, the node value cannot be simply changed
1. Double pointer iteration
Idea:
Create two pointers pre and cur. Pre initially points to nu ...
Posted by brett on Sat, 22 Jan 2022 00:03:31 +0100
Java data structure and algorithm_ Linear table_ Sequential list and linked list
Linear table
summary
Linear table is the most basic, simplest and most commonly used data structure.A linear table is a finite sequence of n data elements with the same characteristics.
Pioneer element: if element A is in front of element B, it is called the precursor element of B Successor element: if element B is after element a, it ...
Posted by mmitdnn on Fri, 21 Jan 2022 05:27:02 +0100
C + + learning notes - container
container
classification
Sequence container: objects are arranged in order and indexed with valuesAssociated container: the order of objects is not important, and keys are used for indexingAdapter: adjust the behavior of the original container to expose new type interfaces or return new elementsGenerators: constructing element sequences
Sequ ...
Posted by AZDoc on Thu, 20 Jan 2022 23:38:44 +0100
Foundation compaction: basic data structure and algorithm
In the previous chapter, we talked about 10 common data structures, and then we talked about 10 common algorithms.
Address of the previous chapter: Foundation compaction: Basic data structure and algorithm (I) , you can have a look if you don't know much.
10 common algorithms
The content of data structure research is how to organize t ...
Posted by spudmclard on Thu, 20 Jan 2022 18:41:33 +0100