Tag：Complexity

Time：2021919
1、 Algorithm efficiency There are two kinds of algorithm efficiency analysis: 1. Time efficiency Time efficiency is also called time complexity. It mainly measures the running speed of an algorithm. 2. Space efficiency Spatial efficiency is also called spatial complexity. It mainly measures the additional space required by an algorithm. In the early stage of […]

Time：2021916
Start the leetcode series of dynamic programming. Self supplement related to theoretical knowledge points, old rules, or start with simple topics. Leetcode70 This is an entrylevel topic. Find the total number of methods for N steps. When you reach the last step n, there are only two situations, one is from n1 (one step) and […]

Time：2021915
Given a binary tree and two levels of numbers “low” and “high”, print nodes from low level to high level. For example consider the binary tree given in below diagram. Input: Root of below tree, low = 2, high = 4 Output: 8 22 4 12 10 14 A simple method First, write a recursive […]

Time：2021913
50. Pow(x, n) Realize pow (x, n), that is, calculate the Npower function of X. Example 1: Input: 2.00000, 10Output: 1024.00000 Example 2: Input: 2.10000, 3Output: 9.26100 Example 3: Input: 2.00000, – 2Output: 0.25000Explanation: 22 = 1 / 22 = 1 / 4 = 0.25 explain: 100.0 < x < 100.0N is a 32bit signed […]

Time：2021911
Interview question 30. Stack containing min function This question is the same as leetcode 155: https://leetcodecn.com/problems/minstack/ O (1) complexity cannot be achieved without using additional space.Define an additional stack m to store the current minimum value. Reference and detailed analysis: the problem solution of liwei1419 Python solution class MinStack: def __init__(self): “”” initialize your data […]

Time：202194
The sorting algorithm must be familiar to everyone. As one of the most basic and important algorithms, the classical sorting algorithm is often required to tear the code by hand in the interview. But there are too many sorting algorithms (see the figure below). Some names sound inexplicable, such as cocktail sorting, dwarf sorting, pancake […]

Time：202192
Interview question 40. Minimum K number Random selection algorithm can be used here. The average time complexity is O (n), and in the worst case, the time complexity is O (n ^ 2). In addition, a more complex bfprt algorithm can be used. The advantage is that the average time complexity and the worstcase time […]

Time：202191
Crazy technology houseAuthor: Nick sweetingEnglish Title: shape your Redux store like your databaseOriginal English:https://hackernoon.com/shape…Explanation: this column is first published in the official account: jingchengyideng. Using indexes, you can represent data from multiple dimensions（ This should be a moving picture, please see the original text) Recently, when browsing some discussions on JavaScript in the RC chat […]

Time：202191
Time and space complexity of the algorithm Post analysis Disadvantages: the running time of algorithms is different under different data scales and different machines, so it is impossible to calculate the running time Prior analysis Large o time complexity With the increase of N, the running time of the program follows the trend of n […]

Time：2021826
concept Microservices architecture is an architectural style. A large complex software application is composed of one or more microservices. Each microservice in the system can be deployed independently, and each microservice is loosely coupled. Each microservice focuses on completing only one task and completing it well. In all cases, each microservice represents a small business […]

Time：2021825
Series articles： Algorithm and data structure series (I) – level differentiated understanding of algorithms Algorithm and data structure series (II) – Basic preparation before implementation Algorithm and data structure series (III) – select sort Algorithm and data structure series (IV) – insertion sorting method – insert sort Algorithm and data structure series (V) – improvement […]

Time：2021823
Here I have summarized several problems of bit operation, which are 136, 137260 and 645 respectively. A total of four problems are added up. All the four questions are the routines of bit operation. If you want to practice bit operation, don’t miss it Appetizer Before we start, let’s learn about XOR, which we’ll use […]