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
ES6 module (introduction, features)
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.
The module of ES6 automatically turns on the strict mode, ...
Posted by dheeraj on Wed, 02 Mar 2022 14:48:58 +0100
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.
This feeling is stil ...
✨ 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 i ...
Posted by bobby4 on Tue, 01 Mar 2022 16:06:21 +0100
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
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
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
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
🌟 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 prod ...
Posted by Porkie on Tue, 01 Mar 2022 00:12:27 +0100
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 += [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