Experiment 3 banker algorithm

Experiment 3 deadlock avoidance algorithm of process 1, Experimental purpose According to the idea of banker algorithm, write a program to solve the deadlock problem of concurrent processes. 2, Background knowledge This experiment requires the design and implementation of banker algorithm. Banker algorithm is a classic deadlock avoidance al ...

Posted by travelbuff on Tue, 02 Nov 2021 17:59:15 -0700

leetcode [stack and queue - simple] 232. Stack implements queue

preface Hello, I'm long Lu. I'm just a junior now. I'm working on the back end and occasionally on the front end. Now the main language is Java. For a long time before, I was learning some technologies of web development. I haven't studied and brushed questions like data structures and algorithms for a long time. I plan to pick them up and ...

Posted by rivasivan on Tue, 02 Nov 2021 12:17:37 -0700

Introduction to algorithm C-876. Intermediate node of linked list

LeetCode problem brushing - algorithm learning plan (Introduction) Title Description Introduction of ideas My idea: first obtain the length len of the linked list, and the len / 2 + 1 node is the intermediate node (starting from 1) The official provides the fast and slow pointer method. I think it's good. See the following for ...

Posted by BlaineSch on Tue, 02 Nov 2021 10:30:34 -0700

Summary of common algorithm templates - fast, maximum common divisor, minimum common multiple, sum of all factors of a number, prime judgment

1. Quick template. The template of fast power should be familiar to you. I always remember the template directly before. Today, let's explain the meaning of fast power template in detail. The template without taking the mold is as follows: (modify the mold by yourself) ll fp(ll a,ll b){ ll ans=1; ll base=a; while(b!=0){ if(b&1!=0) ...

Posted by waq2062 on Tue, 02 Nov 2021 07:38:42 -0700

Day_08 array sorting algorithm

Array sorting algorithm Algorithm = data structure + program code 1. Sorting: Suppose that the sequence containing n records is {R1, R2,... Rn}, and the corresponding keyword sequence is {K1, K2,..., Kn}. Reorder these records to {Ri1,Ri2,... Rin}, so that the corresponding keyword values meet the requirements of Ki1 < = ki2 < =... < ...

Posted by SilentQ-noob- on Tue, 02 Nov 2021 06:46:36 -0700

Prediction of house prices by multiple linear regression algorithm

1, Theoretical learning Learn the reference material "prediction of house prices by multiple linear regression model. ipynb", and re do the multiple linear regression (based on the statistical analysis library statsmodes) for the house data set "house_prices.csv"; It also focuses on understanding biased data, preprocessing ...

Posted by sprocket on Tue, 02 Nov 2021 06:36:09 -0700

Message query IndexFile of RocketMQ

Original:   RocketMQ message query IndexFile (IV) - red hair - personal space - OSCHINA - Chinese open source technology exchange community First, let's look at the process of indexfile, and then analyze and debug the source code step by step. In addition to providing the messages stored in MessageStore to consumer s through ConsumeQueue, ...

Posted by reliable on Tue, 02 Nov 2021 05:32:21 -0700

Depth first search and breadth first search of Graphs

1, Depth first search (DFS) Each time, after accessing the current node, first access the first adjacent node of the current node. You can see that this is a recursive process. Depth first traversal algorithm steps: 1. Access the initial tail node v and mark that node v has been accessed 2. Find the first collar node of node ...

Posted by TechGnome on Tue, 02 Nov 2021 03:23:43 -0700

Top ten sorting algorithms

Bubble sort algorithm Bubble sorting repeatedly traverses the sequence to be sorted, comparing two adjacent elements each time, and exchanging them if their order is wrong. Repeat the traversal until there is no need to exchange, indicating that the sequence has been sorted. Algorithm steps: Compare adjacent elements: if the first is la ...

Posted by hendoyeah on Tue, 02 Nov 2021 00:30:03 -0700

Data structure and algorithm III [single linked list]

1. Linked list The construction of sequence table needs to know the data size in advance to apply for continuous storage space, and the data needs to be relocated during expansion, so it is not very flexible to use. Linked list structure can make full use of computer memory space and realize flexible dynamic memory management. 1.1 definit ...

Posted by arkleyjoe on Mon, 01 Nov 2021 10:34:40 -0700