[LeetCode] LRU cache - least recently used cache mechanism - JavaScript description - Map - bidirectional linked list

Hi~ Hello, I'm YK bacteria 🐷 , A microsystem front end ✨, Love to think, love to summarize, love to record, love to share 🏹, Welcome to pay attention to me 😘 ~ [micro signal: yk2012yk2012, WeChat official account: ykyk2012] Let's talk about my fate with this question first. The intervieUTF-8...

Posted by mrdeadman on Thu, 09 Dec 2021 23:28:29 +1030

[Leetcode] binary tree & binary search tree -- python version

Binary tree Flip binary tree class TreeNode: def __init__(self,val=0,left=None,right=None): self.val = val self.left = left self.right = right class Solution: def invertTree(self,root): if root is None: return None tmp = root.left root.left = root.right root.right = tmp self.invertTree(root.lefUTF-8...

Posted by kooks on Sat, 11 Dec 2021 22:00:09 +1030

Data structure binary tree related interview questions Java version LeetCode questions ------ binary tree

Basic interview questions Question 1: preorder traversal of binary tree. LeetCode144: Preorder traversal of binary tree Description: Give you the root node of the binary tree, root, and return the preorder traversal of its node value. (recursive solution) class Solution { public List UTF-8...

Posted by voidstate on Mon, 13 Dec 2021 10:05:13 +1030

Algorithm problem brushing (LeetCode 6-10)

6. Z igzag transformation 9 / 2 A given string s is arranged in a zigzag manner from top to bottom and from left to right according to the given number of rows numRows. For example, when the input string is "paypalishing" and the number of lines is 3, the arrangement is as follows: P A H N A PUTF-8...

Posted by sobbayi on Wed, 15 Dec 2021 05:50:04 +1030

LeetCode clearance: by sorting five questions in one second, comfortable!

Brush Title Route Reference: https://github.com/chefyuan/algorithm-base Hello, I'm the third person who asked me to brush the title with the output blog. I learned the top ten rankings before: Long Text|Ten basic sorting, done once! Next let's see if there are any questions on the power button UTF-8...

Posted by mybikeisace on Wed, 15 Dec 2021 08:35:01 +1030

[small Y learning algorithm] ⚡ Daily LeetCode punch in ⚡ ️——25. Middle order traversal of binary tree

📢 preface 🚀 Algorithm problem 🚀 🌲 Punching out an algorithm problem every day is not only a learning process, but also a sharing process 😜🌲 Tip: the problem-solving programming languages in this column are C# and Java🌲 To maintain a state of learning every day, let's work together to beUTF-8...

Posted by IanM on Wed, 15 Dec 2021 09:04:06 +1030

Binary search under array

I believe you are not unfamiliar with binary search, or you may have an understanding of its principle, but why do many students abandon the binary search method as soon as they see it? Through several questions, let the students have a deeper understanding of binary search. Next is the time foUTF-8...

Posted by rockinaway on Thu, 16 Dec 2021 07:38:01 +1030

Experience of sword finger offer

Many simple questions seem simple, but they are not simple, because the interviewer will let you have a variety of solutions and make the algorithm with the lowest time complexity. Therefore, the time complexity and space complexity must be recorded in the problem brushing process!!! Array topUTF-8...

Posted by morganchia on Thu, 16 Dec 2021 15:34:28 +1030

Binary tree problem

Binary tree problem Binary tree related problems can be solved by recursion, which is a good way for us to practice recursion. Recursive ladder has two key steps: 1. Recursive end condition. (when does the program exit) 2. Recurrence formula. As long as these two results are found, the recursioUTF-8...

Posted by mbarmawi on Fri, 17 Dec 2021 05:34:16 +1030

What, leetcode easy level? Five solutions: strike hard

Input a linked list and output the penultimate node in the linked list. In order to conform to the habit of most people, this question starts from 1, that is, the tail node of the linked list is the penultimate node. For example, a linked list has six nodes. Starting from the beginning, their vUTF-8...

Posted by bedrosamo on Fri, 17 Dec 2021 11:00:28 +1030