leetcode lecture on algorithm interview in Dachang 8. Sliding window
leetcode lecture on algorithm interview in Dachang 8. Sliding window
Video tutorial (efficient learning): Click to learn
catalog:
1. Introduction
2. Time and space complexity
3. Dynamic planning
4. Greed
5. Binary search
6. Depth first & breadth first
7. Double pointer
8. Sliding window
9. Bit operation
10. Recursion & divide and conque ...
Posted by ierpe on Sat, 27 Nov 2021 02:28:20 +0100
Leetcode Title (Binary Search)
This article is based on Datewhale Phase 31 Team Learning
Binary Lookup Code:
class Solution:
def search(self, nums: List[int], target: int) -> int:
left = 0
right = len(nums) - 1
# Find target within interval [left, right]
while left <= right:
# Take Interval Middle Node
mid = ...
Posted by brynjar on Wed, 24 Nov 2021 18:56:22 +0100
23 Blue Bridge Cup Martians
Daily question 1 - Martians
subject
Man finally landed on the land of Mars and met the mysterious Martians. Neither humans nor Martians can understand each other's language, but our scientists have invented a way to communicate digitally. This communication method is like this. First, the Martians tell human scientists a very large number. ...
Posted by vishi83 on Tue, 23 Nov 2021 05:09:54 +0100
[resolve data structure] explain the set structure in detail and implement a set
📢 Hello, I'm Xiaocheng, a sophomore front-end enthusiast
📢 This article will explain collections in data structures
📢 Thank you very much for reading. You are welcome to correct the wrong places 🙏
📢 May you be loyal to yourself and love life
đź’ˇ First look at knowledge points
What is a collection?What methods do collecti ...
Posted by bcoffin on Mon, 22 Nov 2021 12:40:27 +0100
Brush wave dynamic programming~
preface
There are too few problems in dynamic programming. Brush some problems, practice the awareness of solving problems with dynamic programming and know some common skills.Each question in the article has written some important points and ideas for me to understand this question.If you have any questions, please comment.
1. Sword fi ...
Posted by The End on Mon, 22 Nov 2021 03:37:20 +0100
[LeetCode] 1255. Maximum Score Words Formed by Letters
Given a list of words, list of single letters (might be repeating) and score of every character.
Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times).
It is not necessary to use all characters in letters and each letter can only be used once. Score of letters 'a', 'b' ...
Posted by linfidel on Sun, 21 Nov 2021 21:23:46 +0100
[LeetCode binary tree] delete nodes in the binary search tree (450)
1. Title
Given the root node root and a value key of a binary search tree, delete the node corresponding to the key in the binary search tree and ensure that the nature of the binary search tree remains unchanged. Returns a reference to the root node of a binary search tree that may be updated.
Generally speaking, deleting a node can ...
Posted by comicrage on Sun, 21 Nov 2021 02:18:49 +0100
Chain structure of binary tree and some basic operations on chain binary tree
This paper summarizes some basic operations of chained binary tree in class, including
Calculate the number of nodes of the binary treeCalculate the number of leaf nodes of binary treeCalculate the number of nodes in the K-th layer of the binary treeCalculate the depth / height of the binary treeFind and return the node with the value of x ...
Posted by Jenling on Sun, 21 Nov 2021 00:57:15 +0100
Usage of java FileOutputStream output stream
Construction method of FileOutputStream
FileOutputStream Four common construction methods are provided for instantiation FileOutputStream Object,
Different scenarios use different construction methods.
Scenario 1: use the File object to open a local File and read data from the File.
public FileOutputStream(File file) throws FileNotFoundExce ...
Posted by robviperx on Sat, 20 Nov 2021 13:19:47 +0100
[LeetCode question brushing diary] common question types of array questions
This article summarizes the leetcode problem about arrays, and basically finds out the problem-solving ideas and methods of array problems. So that you can quickly find ideas and solutions when you encounter similar problems later.
303. Region and retrieval - array immutable
Given an integer array nums, find the sum of the elements in ...
Posted by fiorelina21 on Sat, 20 Nov 2021 01:31:03 +0100