Day 12 & PriorityQueue

"This is the fourth day of my participation in 2022's first update challenge. See the activity details: 2022 first update challenge」 This blog post will be released in Nuggets community first! subject The daily practice is changed from the original > = 5 questions to > = 3 questions. There is no way, > = 5 questions are a ...

Posted by mrjameer on Sat, 22 Jan 2022 14:18:07 +0100

Dynamic Planning: Edit Distance

//d[i][j] i s the longest subsequence containing s[i-1] elements in s[0, i-1] and t[0, j-1] 1. Problem Guidance 1: Judging Subsequences 392.Judgement Subsequence Given string s and t ,judge s Is it t Subsequence. A subsequence of a string is a new string formed by the original string deleting some (or no) characters without changing the re ...

Posted by jgires on Sat, 22 Jan 2022 13:29:42 +0100

C language data structure (Zhu Zhanli): tree

Data structures: trees 1, Tree 1. Definition of tree A set composed of N nodes, n=0 is called an empty tree, and a tree with n=1 has only one node. For a tree with n > 1, T has: The top node is called the root node, and the root node has no precursor nodeExcept for the root node, the other nodes are divided into m disjoint sets, and each ...

Posted by buddymoore on Sat, 22 Jan 2022 09:31:54 +0100

Notes on brush questions of sword finger Offer

Mind map remarks: Most of the questions and solutions of the sword finger Offer are the crystallization of the leaders in the solution area. They are only used for personal learning Positive sequence Edition 03 duplicate number in array Title: find duplicate numbers in the array. All numbers in an array num of length n are in the ra ...

Posted by alecapone on Sat, 22 Jan 2022 08:40:18 +0100

Data structure Chapter 3 (stack and queue)

1. Definition and characteristics of stack and queue 1.1 definition and characteristics of stack stack: a linear table that is restricted to insert or delete operations only at the end of the table top: end of tablebottom of stack: header endEmpty stack: an empty table without elements**Linear table of Last In First Out (LIFO) * *: the fir ...

Posted by codrgii on Sat, 22 Jan 2022 02:10:25 +0100

On the unique methods of LinkedList

1, What is a LinkedList collection LinkedList: the LinkedList class implements the List interface and the Collection interface. It is the link List implementation of the List interface. All elements (including null) are allowed. These operations allow a linked List to be used as a stack, queue, or double ended queue. This class provides queue ...

Posted by whizard on Sat, 22 Jan 2022 02:07:45 +0100

Explanation of Leetcode UHF questions

High frequency questions (I) 1, Reverse linked list (206) Title Description: Note: the more accurate expression should be that the result of inversion is 1 ⬅ two ⬅ three ⬅ four ⬅ 5. In other words, the node value cannot be simply changed 1. Double pointer iteration Idea: Create two pointers pre and cur. Pre initially points to nu ...

Posted by brett on Sat, 22 Jan 2022 00:03:31 +0100

[data structure and algorithm] - time complexity and space complexity

Algorithm efficiency Measuring the quality of an algorithm depends on the efficiency of the algorithm, and the efficiency of the algorithm is measured by two dimensions of time and space, namely time complexity and space complexity. Time complexity mainly measures the speed of an algorithm, and space complexity measures the additional spac ...

Posted by hayw0027 on Fri, 21 Jan 2022 23:33:27 +0100

kruskal algorithm (kruskal algorithm) detailed explanation

kruskal algorithm (kruskal algorithm) detailed explanation There are two common methods to find the minimum spanning tree in connected networks, which are called prim algorithm and Kruskal algorithm. In this section, we will explain the Kruskal algorithm to you. The method of Kruskal algorithm to find the minimum spanning tree is to sort all ...

Posted by Addos on Fri, 21 Jan 2022 13:07:59 +0100

Algorithm analysis and Design -- knapsack problem

Given n items and a backpack. The weight of item i is wi > 0, its value is VI > 0, and the capacity of the backpack is c. How to select the items to be loaded into the backpack to maximize the total value of the items loaded into the backpack? (backtracking is required) Steps: Enter the item quantity n;Input the weight wi and value vi o ...

Posted by javiqq on Fri, 21 Jan 2022 12:41:57 +0100