[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "N Queen"
1, Title Requirements
The n queen problem studies how to place n queens in n × N's chessboard, and the Queens can't attack each other.Give you an integer n and return the solution of all different queen n problems.Each solution contains a different chess placement scheme for the n-queen problem, in which 'Q' and ' They represent the quee ...
Added by Wolverine68 on Sat, 05 Feb 2022 20:09:42 +0200
In-depth Analysis of Data Structure and Algorithms Solving Ideas and Examples of Alphabetic Word Grouping
1. Title requirements
You will be given an array of strings, which you can return in any order by combining heterographic words.Alphabetic words are new words that result from rearranging the letters of the source word, and the letters in all source words are usually used exactly once.Example 1:
input: strs = ["eat", "tea", "tan", "ate", "nat ...
Added by iamtom on Sat, 05 Feb 2022 19:14:15 +0200
[greedy algorithm] quick start and practical training
I saw high-quality classroom works on station b. I analyzed them with my own understanding to help you better understand them
Of course, we still need to know what is greedy algorithm:
1. Greedy algorithm means that when solving a problem, it always makes the best choice, that is, it does not consider the overall optimization. What the algori ...
Added by justsomeone on Sat, 05 Feb 2022 14:09:50 +0200
Infix expression to suffix expression and evaluation
Because in the school is really too idle, so wrote an expression evaluation of the C language program, hope big guys can correct.
Basic idea:
Just like putting an elephant in a refrigerator, we need to evaluate the expression in three steps.
Enter an infix expression (the expression we usually see)Convert infix expression to suffix express ...
Added by neo926 on Sat, 05 Feb 2022 13:47:10 +0200
Necessary exercises for College Students - 50 classic examples of Java language
I'm Chen PI. I'm an ITer of Internet Coding. I search "Chen Pi's JavaLib" on wechat. I can read the latest article at the first time and reply to [data], so I can get my carefully sorted technical data, e-books, interview data of front-line large factories and excellent resume template.
introduction
During college, Java la ...
Added by jyushinx on Sat, 05 Feb 2022 12:36:38 +0200
Queue of data structure
What is a queue
A queue is a linear data structure. Different from the stack with the same linear data structure, the elements in the queue follow the First In First Out rule. Like queuing in reality, it pays attention to the principle of first come, first served. The exit end of the queue is called the front, and the entrance end of the queue ...
Added by boinnk on Sat, 05 Feb 2022 12:24:08 +0200
24 API4 · 2 - set, HashSet, HashMap
1 Map interface
1.1 general
Java.util interface map < K, V > Type parameter: K - indicates the key maintained by this mapping; V - indicates the corresponding value maintained by this mapping Also called hash table, hash table It is often used for data of key value pair structure The key cannot be repeated and the value can be repea ...
Added by hellonoko on Sat, 05 Feb 2022 10:32:13 +0200
Character function and string function
This blog introduces some functions and how to simulate their implementation
strlen function
Introduction: calculate the length of the string str until the null end character, but excluding the null end character Prototype: size_t strlen(const char *str) Return value: returns the length of the string
Note: 1. The string ends with '\ 0'. strl ...
Added by nuxy on Fri, 04 Feb 2022 16:12:21 +0200
Day 24 of leetcode brushing - 1725, 47, 39, 40
Day 24
1725 number of rectangles that can form the largest square
Give you an array of rectangles, where rectangles[i] = [li, wi] indicates that the length of the ith rectangle is li and the width is wi.
If k satisfies both k < = Li and k < = wi, the i-th rectangle can be cut into a square with side length k. For example, a rectangle [ ...
Added by TheWart on Fri, 04 Feb 2022 11:49:58 +0200
python data structure bubble selection insertion sorting algorithm
Sorting algorithm
Sorting algorithm (English: Sorting algorithm) is an algorithm that can arrange a string of data in a specific order.
Stability of sorting algorithm
Stability: the stable sorting algorithm will maintain the relative order of records with equal key values. That is, if -- sorting algorithm is stable, when there are two reco ...
Added by codygoodman on Fri, 04 Feb 2022 07:03:53 +0200