[question brushing diary] classic questions must be brushed for the introduction of C + +

😀 Hello, I'm Bai Chen. I'm not very able to stay up late 😫, But people who want to get better ✈. If you like this article, give it a compliment 👍, Pay attention 👀 Bai Chen! Your support is my biggest motivation! 💪💪💪 🏹 preface Bai Chen reviewed my C + + learning journey during this period and found many bumps and difficulties. Ther ...

Posted by carrot on Tue, 12 Apr 2022 05:18:24 +0300

Letter combination of telephone number

Title Description Given a string containing only the numbers , 2-9 , returns all the letter combinations it can represent. The answers can be returned in any order. The mapping of numbers to letters is given as follows (the same as telephone keys). Note that 1 does not correspond to any letter. Example 1: Input: digits = "23&quot ...

Posted by smoked1 on Mon, 11 Apr 2022 08:29:23 +0300

Longest return text string

1, Demand Give you a string , s , and find the longest palindrome substring in , s ,. Example 1: Input: s = "babad" Output:"bab" Explanation:"aba" The same answer is in line with the meaning of the question. Tips: 1 <= s.length <= 1000s # consists only of numbers and English letters (uppercase and / or lowercase) 2, Violence ...

Posted by benjudy on Sun, 10 Apr 2022 21:48:15 +0300

Several topics of recursive backtracking

I feel that the ideas of these backtracking topics are quite simple. Put a simple template if (get a solution) { Save answer return } If (unable to get solution) { return } if (data available) { Store data Recursively execute the next layer Pop up the data just saved Recursively execute the next layer } combination Given two integers n and k ...

Posted by tuneout on Sun, 10 Apr 2022 17:46:25 +0300

[Review] computer hardware and Cache; Array algorithm [bisection, double pointer]

Algorithm training Array topics About the introduction of microservices and distribution, bloggers will take time to continue to share. It is impossible to remember all the knowledge, but it is impossible to have an impression + know the location [then it is not to learn new technology, just remember it at a glance]. In the next pe ...

Posted by kireol on Sat, 09 Apr 2022 18:51:45 +0300

1. Sum of two numbers; 15. Sum of three numbers; 18. Sum of four numbers

1. Sum of two numbers; 15. Sum of three numbers; 18. Sum of four numbers 1. Sum of four numbers 1) Title Description Give you an array of n integers, nums, and a target value, target. Please find and return the quads [nums[a], nums[b], nums[c], nums[d]] (if the two Quad elements correspond one to one, it is considered that the two quads are ...

Posted by thepeccavi on Fri, 08 Apr 2022 07:43:29 +0300

Implementing LRU caching algorithm in Java

1. Introduction to LRU LRU (Least Recently Used) is a common page replacement algorithm. In the calculation, all file operations should be carried out in memory. However, the size of computer memory is fixed, so it is impossible for us to load all files into memory. Therefore, we need to formulate a strategy to select the input of files added ...

Posted by Stiffler on Thu, 07 Apr 2022 13:26:05 +0300

Skyline, building contour problem

Catalogue of series articles Tip: it may take some time to write a blog, but only when I stand up and write clearly can I understand it clearly. In order to force myself to learn this algorithm and filter out the ideas of problem-solving, I insist on writing! The skyline problem is the title of LeetCode: Original title link: Skyline contour p ...

Posted by rklapwijk on Wed, 06 Apr 2022 17:14:52 +0300

Time complexity O(n) - level sorting algorithm

Theorem 8.1 of introduction to algorithm: in the worst case, any comparison sorting algorithm needs to make O(nlogn) comparisons. Inference 8.2 of introduction to algorithms: heap sorting and merge sorting are both asymptotically optimal comparative sorting algorithms. Therefore, the time complexity O(n) level sorting algorithms are sorting a ...

Posted by creative on Wed, 06 Apr 2022 16:17:58 +0300

[leetcode]297. Serialization and deserialization of binary tree

Link: https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/ Solution: refer to leetcode and labuladong Difficulty: difficulty /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class C ...

Posted by cx3op on Wed, 06 Apr 2022 09:44:12 +0300