2-SAT problem set -ybtoj

The so-called 2-SAT problem is that there are two SAT problems (errors) SAT is the abbreviation of well posedness problem. The general form is k - well posedness problem, which is abbreviated as k-SAT. And when k > 2 ...

Posted by riwan on Thu, 24 Feb 2022 03:57:36 +0100

Detailed explanation and implementation of MD5 algorithm (C language)

See the column collection for the detailed explanation and implementation of other modern cryptography algorithms~ MD5 algorithm Algorithm process (i) Message filling First, fill in the message so that its length is 64 bits less than the integer multiple of 512 (these 64 bits are used to record the original data length). The filled content c ...

Posted by ziong on Wed, 23 Feb 2022 11:07:18 +0100

Day 5 of Leetcode algorithm Introduction (double pointer)

876. Intermediate node of linked list Title Description Given a non empty single linked list with head node, return the intermediate node of the linked list. If there are two intermediate nodes, the second intermediate node is returned. Sample Input:[1,2,3,4,5] Output:[3,4,5] Explanation: the returned node value is 3 (The serializatio ...

Posted by eazyefolife on Wed, 23 Feb 2022 09:54:43 +0100

PTA -- the team's "food chain" -- the second algorithm exercise of DS&A course practice

1, Title 2, Topic analysis The data structure of the graph needs to be used, and it is a directed graph. It is simpler to use the adjacency table. The adjacency table can be implemented by itself or by STL map+vector. I prefer to use the vector array, which is simple and convenient, but the graph in the question may have repeated direct ...

Posted by lightpace on Wed, 23 Feb 2022 04:33:57 +0100

[algorithm] recursion, search and sorting

1. Recursion Find duplicate Find a way to divideFind recursive formula or equivalent transformation Find change The variable is usually used as a parameter Find boundary Simple basic questions (practice three steps) Find the factorial of n public class demo01 { public static void main(String[] args) { int a = f1(4); System.o ...

Posted by gareh on Tue, 22 Feb 2022 17:43:36 +0100

2022/2/22 BFS dijestra A * routing algorithm

A* search: Combining BFS and greedy algorithm, it is usually used for game pathfinding. A * is one of the heuristic search algorithms BFS: Like ripples, it spreads out circle by circle, but it doesn't care where the end point is Breadth first, store the starting point in the queue, add the points that have not been visited up, down, lef ...

Posted by cowboy_x on Tue, 22 Feb 2022 14:50:56 +0100

day6 list job

1. Basic questions Given a list of numbers, print all odd numbers in the list list1=[22,33,45,67,78] for x in list1: if x%2 !=0: print(x) Given a list of numbers, print all the numbers in the list that can be divided by 3 but cannot be divided by 2 list2=[2,3,6,8,9,10] for x in list2: if x%3==0 and x%2 !=0: print(x) ...

Posted by asherinho on Tue, 22 Feb 2022 13:46:02 +0100

Virtual Dom and diff algorithm

1. What exactly is JSX When you use react, you will write JSX. What is JSX? It is an extension of Javascript syntax. React uses it to describe what the user interface looks like. Although it looks very much like HTML, it is Javascript. Babel will compile JSX into the React API before the react code is executed <div className="container"&gt ...

Posted by uluru75 on Tue, 22 Feb 2022 10:24:46 +0100

LeetCode1994. Number of good subsets - shape pressure DP

Number of good subsets   the data range of this question is relatively small, which determines that state compression dp can be used.    to split the product of all numbers in the subset into different prime factors, the subset must hold different prime factors, and each element subset cannot hold duplicate prime factors. &emsp ...

Posted by cdennste on Tue, 22 Feb 2022 09:55:32 +0100

2022-02-22 swipe questions and punch in every day

2022-02-22 swipe questions and punch in every day All in one -- dynamic programming 1268: [example 9.12] complete knapsack problem [Title Description] There are n kinds of articles, each of which has a weight and a value. However, the number of each item is unlimited. At the same time, there is a backpack with a maximum carrying capacity of ...

Posted by remmy82 on Tue, 22 Feb 2022 08:08:44 +0100