Sprint spring move - selected pen interview 66 questions day22 (end)

day22 topic: 151. Reverse the words in the string,46. Full arrangement,2. Add two numbers Today's knowledge points: string, recursion and linked list. The difficulty is medium, medium and medium Learning plan link: Sprint spring move - selected pen interview 66 questions pass Yesterday's topic link: Sprint spring move - selected pen intervie ...

Posted by wefollow on Tue, 29 Mar 2022 13:55:22 +0300

hugging face tutorial - Chinese Translation - create a custom architecture

Create a custom schema AutoClass automatically deduces the model architecture and downloads the pre trained configuration and weight. In general, we recommend using AutoClass to generate code independent of checkpoints. However, users who want more control over specific model parameters can create custom Transformers models from several base c ...

Posted by Jtech inc. on Tue, 29 Mar 2022 10:14:46 +0300

Problem solving ideas of binary tree / n-ary tree

Binary tree The characteristic of binary tree is that each node can only have two subtrees at most, which can be divided into left and right The data structure of binary tree is as follows: public class TreeNode { //Value of node int val; //Left subtree TreeNode left; //Right subtree TreeNode right; TreeNode(int x) { val ...

Posted by cnl83 on Mon, 28 Mar 2022 16:25:20 +0300

leetcode brush 572 The subtree of another tree, Easy (Java) DFS & violence + DFS&KMP

1. Title Description Here are two binary trees, root and subRoot. Check whether the root contains subtrees with the same structure and node values as the subRoot. If it exists, return true; Otherwise, false is returned. A subtree of a binary tree tree includes a node of the tree and all descendants of this node. A tree can also be regarde ...

Posted by jayjay960 on Mon, 28 Mar 2022 15:45:33 +0300

Linear time selection

problem The general formulation of the element selection problem is: given n elements and an integer k in the linear order set, 1 < = k < = n, it is required to find the K smallest element in the n elements. solution Random time linear selection In the textbook "algorithm design and analysis (Third Edition)" (Wang Xiaodong), ...

Posted by Richardtagger on Mon, 28 Mar 2022 01:55:45 +0300

Blue Bridge Cup - a province of violence

1. Title Description There is an \ n \times mn × m  the chessboard of the square, find out how many squares and rectangles the square contains (excluding squares). Input format One line, two positive integers n,mn,m (n \leq 5000,m \leq 5000n ≤ 5000,m ≤ 5000). Output format One line, two positive integers, respectively indicat ...

Posted by voitek on Sat, 26 Mar 2022 17:10:01 +0300

Sword finger Offer II 116 Number of provinces / circle of friends (medium map bfs and search Collection)

Sword finger Offer II 116 Number of provinces There are n cities, some of which are connected to each other, others are not connected. If city a is directly connected to city b and city b is directly connected to City c, city a is indirectly connected to city c. A province is a group of directly or indirectly connected cities, excluding other ...

Posted by tomwhalen on Sat, 26 Mar 2022 15:49:13 +0300

D14 acwing code implementation 3.2-4.1 + review

Recently, I feel really mature and happy~ Uh huh~ Study~ I didn't go to bed until 3 last night and got up at 6:30 in the morning But it doesn't matter. I love life and study!!! come on. Today, let's implement the code first. If you're tired of implementation, go to review the previous. You'd better watch two more lessons DP hey ~ come on!!! & ...

Posted by recset on Sat, 26 Mar 2022 15:41:34 +0300

Leetcode2207. The maximum number of substrings in a string (medium)

catalogue 1. Title Description 2. Naive Approach enumeration traversal 3. Optimized implementation 1. Title Description Give you a string , text , with a subscript starting from , and another string , pattern with a subscript starting from , 0 , with a length of , 2 , both of which contain only lowercase English letters. You ...

Posted by godster on Sat, 26 Mar 2022 13:51:03 +0300

114. Expand the binary tree into a linked list

114. Expand the binary tree into a linked list Difficulty: medium Here is the root node of the binary tree. Please expand it into a single linked list: The expanded single linked list should also use TreeNode, where the right sub pointer points to the next node in the linked list, and the left sub pointer is always null.The expanded single l ...

Posted by Roo on Sat, 26 Mar 2022 12:28:59 +0300