In depth understanding of computer systems (Third Edition) - Chapter 6 - cache lab

The experiment in this chapter is quite interesting. Simply record the practice. 1, partA partA is relatively simple. It should be noted that the use of LRU and different lines in the same set do not store continuous addresses. Take s = 1, E = 2, b = 1 as an example: the first row of the first set stores 0x2 0xa ···, ...

Posted by Ghostgator on Mon, 29 Nov 2021 20:21:47 -0800

python magic function

preface This blog mainly introduces Python's magic functions. In depth learning or python programming, python class writing will be more or less involved, including Python magic functions. For example, when writing a data loading generator, it may be involved__ next__,__ iter__ Function. Of course, the generator may be done with the keywo ...

Posted by lizard on Mon, 29 Nov 2021 20:15:32 -0800

07_JavaScript data structure and algorithm bidirectional linked list

JavaScript data structure and algorithm (VII) bidirectional linked list One way linked list and two-way linked list Unidirectional linked list You can only traverse from beginning to end or from end to end (generally from beginning to end).The linked list connection process is one-way. The implementation principle is that there is a referenc ...

Posted by foolguitardude on Mon, 29 Nov 2021 20:13:01 -0800

LeetCode brush questions - perfect rectangle

Preface description Algorithm learning, daily problem brushing records. Topic connection Perfect rectangle Topic content Give you an array of rectangles, where rectangles[i] = [xi, yi, ai, bi] represents a rectangle with parallel coordinate axes. The lower left vertex of the rectangle is (xi, yi) and the upper right vertex is (ai, bi). Re ...

Posted by sgoku01 on Mon, 29 Nov 2021 15:25:38 -0800

Computer exercises

13. Given two strings containing only lowercase letters, calculate the length of the maximum common substring of the two strings. Note: the definition of substring refers to a string formed after deleting some prefixes and suffixes (or not deleted). import java.util.*; public class Main{ public static void main(String[] args) { Sca ...

Posted by wesley1189 on Mon, 29 Nov 2021 13:41:36 -0800

String to integer (atoi)

Title: Please realize one   myAtoi(string s)   Function to convert a string into a 32-bit signed integer (similar to the atoi function in C/C + +). function   The algorithm of myAtoi(string s) is as follows: Read in the string and discard useless leading spaces Check whether the next character (assuming it has not reached the ...

Posted by bryson on Mon, 29 Nov 2021 13:28:35 -0800

Tagging education re learning data structure and algorithm 13 | sorting: Principle Analysis and advantages and disadvantages comparison of classical sorting algorithm

Learning resources: Pull hook Education What is a ranking problem Sorting - the process of turning a group of unordered data into order. Generally, the order here is from small to large by defaultMeasure the advantages and disadvantages of a sorting algorithm Time complexity - specifically, the best time complexity, the worst time complexi ...

Posted by barnbuster on Mon, 29 Nov 2021 07:52:34 -0800

java bubble sorting (from simple to complex, from death to life)

For example: int []arr= {25,69,80,57,13,}; Basic idea of bubble sorting (from small to large): compare a[0] with a[1]. If the former is greater than the latter, exchange it before and after, otherwise no operation will be done. After this step, the larger value will be in the latter, that is, a[1]. Now we need to continue to compare to the bac ...

Posted by gaz_hayes on Mon, 29 Nov 2021 01:32:14 -0800

LeetCode-133-clone graph

Clone graphTitle Description: give you a reference to a node in an undirected connected graph. Please return a deep copy (clone) of the graph.Each node in the graph contains its value val (int) and a list of its neighbors (list[Node]).See LeetCode's official website for an example.Source: LeetCode Link: https://leetcode-cn.com/probl... The co ...

Posted by McInfo on Sun, 28 Nov 2021 22:02:50 -0800

Machine design (mountain climbing)

Title Description: let a machine be controlled by n It consists of two parts, and each part can be m From different suppliers. supplier j Supplied parts i With weight Wij And price Cij . Design an algorithm to solve the total price does not exceed the upper limit c The minimum weight of the machine. (design a branch a ...

Posted by ptolomea on Sun, 28 Nov 2021 13:15:28 -0800