Tag:data structure
-
How to read a source code?
The ability to read source code is one of the underlying basic abilities of programmers. The reason why this ability is important is: Inevitably, you need to read or take over other people’s projects. For example, research an open source project, such as taking over a project of others. Reading excellent project source code is […]
-
[moonlight box get √] replace space with time and talk about sparse arrays
background Data structure refers to the collection of data elements with structural characteristics. In the data structure, the data are related together through a certain organizational structure, which is convenient for computer storage and use. In terms of classification, data structures can be divided into linear structure and nonlinear structure, which are suitable for different […]
-
[issue 33] golang school recruitment interview experience sharing Changtian Tour
1. The execution order of go init is not in accordance with the import rules (in this case, it is executed in the order of file names during compilation) 2. Interface nil comparison. 3. Native map is non thread safe, locking and sync Implementation of map {}. 4. The difference between channel no buffer and […]
-
I thought I was awesome with MySQL until I saw the interview question of Alibaba. I didn’t deserve it..
preface As we all know, on the resume, “understand = heard the name; familiar = know what it is; proficient = used; proficient = done something”. I believe everyone is familiar with MySQL index. Index is a data structure that helps MySQL obtain data efficiently. As the key knowledge in mysql, index appears frequently in […]
-
Let’s take a look at the new front-end column “advanced incomplete guide”
background This article is included inAdvanced incomplete Guidespecial column According to the practice of previous series of articles, the first article is generally a background introduction and outline extraction. This series is still the same (there is no way to improve your writing ability here.) First of all, express my writing purpose: Share it with […]
-
1.4 find the maximum or minimum n elements
Problem description How do I get a list of the largest or smallest n elements from a collection? Solution The heapq module has two functions:nlargest()andnsmallest()Can solve this problem perfectly. import heapq nums = [1, 8, 2, 23, 7, -4, 18, 23, 42, 37, 2] print(heapq.nsmallest(3, nums)) #Output result: [- 4, 1, 2] print(heapq.nlargest(3, nums)) #Output […]
-
[daily algorithm / brush through leetcode] 7 Integer inversion (simple)
Click here to view more content related to algorithmic interview~ Title Description Given a 32-bit signed integer, you need to reverse the number on each of the integers. be careful: If the − environment has an integer of ^ $1}, we can only store the value of ^ $2} in the range of ^ $31 […]
-
Javase (8) – detail Madness: 21k word in-depth understanding of classes and objects
catalogue preface 1. Object oriented preliminary cognition 1.1 what is object-oriented 1.2 object oriented and process oriented 2. Class definition and use 2.1 simple cognition 2.2 definition format of class Instantiated class 3.1 what is instantiation 3.2 description of classes and objects 3.3 summary 4. This reference 4.1 why is this referenced 4.2 what is […]
-
JavaScript & ES6 —- four methods of array de duplication
Method 1—Double layer for loop Use the double-layer for loop. Compare the items before the previous loop and the items after the next loop. If you find a duplicate, use the split () attribute to delete the duplicate elements from the array arr let arr = [2,5,1,5,3,2,’hello’,’1′,4] let unique = (arr) =>{ //The first layer […]
-
Differences among foreach, for in and for of
In the development process, we often need to cycle through arrays or objects, and use the most methods foreach, for… In, for… Of to sort out their similarities and differences For loopIn fact, in addition to these three methods, there is also the most primitive traversal. The for loop has been used since the birth […]
-
Underlying principle (XI) — Design Pattern and architecture
What is architecture? ArchitectureDesign scheme in software developmentThe relationship between classes, the relationship between modules, and the relationship between client and server Frequently heard structural nouns MVC、MVP、MVVM、VIPER、CDDThree tier architecture, four tier architecture …… MVC – Apple The more common is uitableviewView and model are invisible to each other, and they are transmitted through VC MVC […]
-
Java collection framework (analysis of source code, in-depth explanation)
Java collection framework preface 1、 Introduce 2、 Overview 3、 Collection interface 1. General 2. Method 2.1 add 2.2 get the number of valid elements 2.3 empty collection 2.4 judge whether it is an empty set 2.5 determining whether an element is included 2.6 deletion 2.7 taking the intersection of two sets 2.8 judge whether the […]