[Java design mode] IV. 4.1 creator mode - single example mode
The main focus of creative mode is "how to create objects?", Its main feature is "separating the creation and use of objects".
This can reduce the coupling degree of the system, and users do not need to pay attention to the creation details of objects.
The creation mode is divided into:
Singleton modeFactory method modelA ...
Posted by fewtrem on Tue, 01 Mar 2022 04:30:55 +0100
C language to achieve mine sweeping (detailed explanation)
๐ What is minesweeping
Mine clearance refers to the search and clearance of mines, mines and other explosives, which is usually carried out in the areas occupied and recovered by our own side. The purpose of mine clearance is to ensure the freedom of movement of the army and the safety of residents' lives and property, and restore normal prod ...
Posted by Porkie on Tue, 01 Mar 2022 00:12:27 +0100
Sort array collapse array de redo callback function
Sort array collapse array de redo callback function
Bubble sorting
significance
It is to adjust an out of order array into an ordered array through the execution of code
Logic:
โ 1. Traverse the array, compare two by two, and move the relatively large number backward
โ 2. After traversing, the result is that the largest number must be a ...
Posted by miro on Mon, 28 Feb 2022 14:09:48 +0100
leetcode problem solving hash
4, Hash
1. 242 effective letter ectopic words
Given two strings s and t, write a function to judge whether t is an alphabetic ectopic word of s.
Note: if each character in S and t appears the same number of times, s and T are called alphabetic words.
Source: LeetCode Link: https://leetcode-cn.com/problems/valid-anagram The copyright be ...
Posted by kustomjs on Mon, 28 Feb 2022 14:07:24 +0100
Leetcode must Review seventeen Lintcode (423 492 541 421 575)
423 ยท valid parenthesis sequence
Given a sequence of parentheses represented by a string, it contains the following characters: '(', ')', '{', '}', '[' and ']' to determine whether it is a valid sequence of parentheses.
Brackets must be expressed in the order of '()', '() [] {}' is a valid bracket, but '([)]' is an invalid bracket. ...
Posted by liljim on Mon, 28 Feb 2022 09:05:19 +0100
Share two common search algorithms: BFS and DFS
This article is shared from Huawei cloud community< Preliminary study on BFS and DFS algorithms >, author: ayin.
This time I share two common search algorithms 1.BFS is breadth first search 2.DFS is depth first search
Number of islands
Given a two-dimensional grid consisting of '1' (land) and '0' (water), calculate the number of island ...
Posted by Roble on Mon, 28 Feb 2022 02:19:13 +0100
[leetcode SQL daily practice] - 1179 Reformat department table
๐ Write in front
๐โโ๏ธ Hello everyone, I'm super dream. You can call me Xiaomeng~
It's time to practice SQL again! Let's study together!
๐โโ๏ธ If you don't understand anything in the learning process, you are welcome to leave a message and ask questions in the comment area. Xiaomeng will tell you everything.
catalogue
๐ ...
Posted by bmcua on Mon, 28 Feb 2022 00:10:41 +0100
Cardinality sort - radius sort
Cardinality sort
Introduction to cardinality sorting (bucket sorting):
radix sort belongs to "distribution sort", also known as "bucket sort" or bin sort. As the name suggests, it allocates the elements to be sorted to some "buckets" through the values of each bit of the key valueThe cardinal ranking method is ...
Posted by SundayDriver on Mon, 28 Feb 2022 00:06:20 +0100
Shortest path algorithm
1.Dijkstra algorithm
1.1 algorithm flow interpretation
1. Initialization:
The shortest path length of the starting point is set to zero, and the shortest path length of the other points is set to positive infinity.
2.n wheel slack:
Dij algorithm divides the points into the set of points with the shortest path and the set of points without ...
Posted by dk1983 on Sun, 27 Feb 2022 14:19:09 +0100
2022 winter vacation algorithm summary
1, Introduction to algorithm
1. Simple version
2022-1-11
704. Binary search
Topics and examples Given an n-element ordered (ascending) integer array nums and a target value target, write a function to search the target in nums. If the target value exists, return the subscript, otherwise return - 1.
Example 1: Input: num = [- 1,0,3,5,9,12], ...
Posted by vapour_ on Sun, 27 Feb 2022 11:38:53 +0100