Hand tearing algorithm -- LRU cache elimination strategy, asked so often

As we all know, the size of cache is limited! When the cache is full, it requires a cache elimination strategy to determine which data should be cleaned out. There are three common strategies: First In, First Out (FIFO), Least Frequently Used (LFU) and Least Recently Used (LRU). Take a look at this LRU design question on LeetCode: 1.Please de ...

Posted by Topper on Wed, 02 Mar 2022 15:59:16 +0100

Detailed explanation of ES6 module and CommonJS and their differences

ES6 module (introduction, features) introduce ES6 introduces modularity. Its design idea is to determine the dependencies of modules and the variables of input and output at compile time. The modularization of ES6 is divided into two modules: export @ and import. characteristic The module of ES6 automatically turns on the strict mode, ...

Posted by dheeraj on Wed, 02 Mar 2022 14:48:58 +0100

Codeforces 1638 E. Colorful Operations - segment tree + violence, something

This way Meaning: Give you an array a with length n. at the beginning, the color of all positions is 1 and the value is 0 There are three operations at a time: Color l r x: change the color of all positions in [l,r] to X Add c: add c to the values of all positions with color c Q: what is the value of Query i. Solution: This feeling is stil ...

Posted by jguy on Wed, 02 Mar 2022 04:02:45 +0100

Common algorithm sorting

โœจ preface โœจ ๐Ÿ“˜ Blog home page: to Keep blog home page ๐Ÿ™† Welcome to pay attention, ๐Ÿ‘ give the thumbs-up, ๐Ÿ“ Message comments โณ Starting time: March 1, 2022 ๐Ÿ“จ Blogger code cloud address: Blogger code cloud address ๐Ÿ“• Reference book: java core technology Volume 1 ๐Ÿ“ข Programming exercises: Niuke network+Force buckle net As the blogger is also in ...

Posted by bobby4 on Tue, 01 Mar 2022 16:06:21 +0100

Force deduction question 160 Intersecting linked list

subject Here are the head nodes headA and headB of the two single linked lists. Please find and return the starting node where the two single linked lists intersect. If there is no intersecting node between the two linked lists, null is returned. As shown in the figure, two linked lists intersect at node c1: The title data ensures that ...

Posted by jesbin on Tue, 01 Mar 2022 14:21:24 +0100

JAVA day 41 - hash table

1, You don't know hash tables 1. What is a hash table? We already know a data item, keyword mapping storage location.In fact, our search process is to compare and constantly compare keywords, so that we can find the storage location.Now you should find that they are like functions, X = keyword and Y = storage location.The difficulty of ha ...

Posted by Averice on Tue, 01 Mar 2022 14:09:52 +0100

[charm of data structure] 001 Cognitive complexity & dichotomy & XOR operation

Constant time operation If the execution time of an operation is not transferred by the specific sample size, each execution time is a fixed time. Such operations are called constant time operations. Common arithmetic operations (+, -, *, /,%, etc.)Common bit operations (> >, > > >, < <, |, &, ^, etc.)Assignment, comp ...

Posted by Leadwing on Tue, 01 Mar 2022 13:25:55 +0100

Linear table - 04 stack

Write before: Today, let's learn about the stack structure. The stack can also be called directly in C + + STL, but we can use C + + to realize the stack structure. Definition of stack The stack meets the principle of "first in and last out", that is, it can only be inserted and deleted from the tail. The implementation of the sta ...

Posted by rReLmy on Tue, 01 Mar 2022 12:12:51 +0100

C language to achieve mine sweeping (detailed explanation)

๐ŸŒŸ What is minesweeping Mine clearance refers to the search and clearance of mines, mines and other explosives, which is usually carried out in the areas occupied and recovered by our own side. The purpose of mine clearance is to ensure the freedom of movement of the army and the safety of residents' lives and property, and restore normal produ ...

Posted by Porkie on Tue, 01 Mar 2022 00:12:27 +0100

A puzzle about + =

Original link: A puzzle about + = I found a problem in reading today. It's very interesting to share with you. What are the results of the following two Python expressions? t = (1, 2, [3, 4]) t[2] += [5, 6] Give four alternative answers: t becomes (1, 2, [3, 4, 5, 6]).Because tuple does not support assigning values to its elements, it thr ...

Posted by jimdavidson on Mon, 28 Feb 2022 05:40:58 +0100