webnovel
leetcode 12

leetcode 12

Quick sort leetcode
Quicksort was an efficient sorting algorithm. The principle was to divide the records to be sorted into two independent parts by sorting. The keywords of one part of the records were smaller than the keywords of the other part of the records. Then, the two parts of the records were sorted separately to achieve the order of the entire sequence. In terms of code implementation, there are the following sorting steps: first select the data of the left node as the pivot (reference value), start from the right, traverse the node data to the left (under the premise that the right > left condition is met), if the node data> pivot, continue to move to the left; If the node data <= pivot, assign the data of the current node to the left node, then stop the right traverse and start the left traverse. Starting from the left, traverse the node data to the right (under the premise that the left > right condition is met). If the node data < pivot, continue to move to the right; if the node data>= pivot, assign the current node data to the right node, then stop the left traverse and start the right traverse. When left and right overlap, the traverse ends, and the pivot is assigned to the coincidence node. The left side of the pivot node is the left array, and the right side is the right array. After that, the above steps were performed on the left array and the right array to complete the quick sorting. In addition, the principle of quick sorting was also applicable when dealing with some related problems in Leetcode (such as the k-th smallest number and k-th largest number in the Leetcode topk problem). However, in different scenarios, it may be necessary to make appropriate adjustments according to the requirements of the question and the characteristics of the data structure. For example, when sorting the linked list, it may not be suitable to use the classic quick sort because the single-directional nature of the linked list is not good to traverse from the back to the front. If additional forward connections are added, additional space is needed.
1 answer
2026-08-11 21:03
Share your LeetCode success stories.
I had a LeetCode success story where I focused on understanding the problem - solving patterns. I noticed that many problems had similar underlying concepts. So, I made a list of common patterns like two - pointer, sliding window, and dynamic programming. I studied each pattern intensively, practiced related problems, and soon I could quickly identify which pattern to apply to a new problem. This approach really sped up my progress on LeetCode.
1 answer
2024-12-05 12:28
How did you achieve success on LeetCode?
For me, achieving success on LeetCode was about learning from others. I read a lot of solutions posted by top - rated users. Their code was often very clean and efficient. I studied how they used different data structures and algorithms. One time, I was stuck on a binary search problem. After looking at someone else's solution, I understood a better way to handle the boundary conditions. This way of learning from the community was really helpful.
1 answer
2024-12-06 01:37
Fighting through the sky, listening to novels
Battle Through the Heavens audio novel can be listened to on multiple platforms. For example, the version that was broadcasted by the host Ayla was completed and the update time was 10 - 25. Its playlist contains many episodes. In addition, there were also apps that supported android 2.1, such as Battle Through the Heavens, which could be used to listen to books. In the story, Xiao Yan had a rich experience. He possessed a mysterious Dou Qi since he was young but was unable to awaken it. Later, he obtained an ancient book that recorded the 'Flame Mantra' Qi Method and stepped onto the path of training. During the training process, he met companions and experienced hardships to grow. His Dou Qi continued to become stronger and was able to swallow 'Heavenly Flame'. However, it also attracted many enemies, such as the' Hall of Souls'. He engaged in a life and death battle with his enemies and ultimately won. After that, he continued to explore the Dou Qi continent, search for 'Heavenly Flame', comprehend the true essence of Dou Qi, and become a Dou Di. The content of the book also involved his experience in the immortal and demon world, such as being involved in various missions, gains and losses in the mission, being used by the strong, and other plots, as well as his experience in alchemy. Hurry up and click on the link below to return to the original classic, Battle Through the Heavens!
1 answer
2026-09-21 23:44
The Perfect World's Red Phoenix and Shi Hao's relationship novel
The relationship between Shi Hao and the red phoenix was extremely unique. The first time they met was on the spiritual ship heading to the Unaging Mountain. Red Phoenix was a noble lady from the upper realm, and she took the initiative to ask Shi Hao for advice. Due to the fact that their precious techniques were extremely similar during their sparring, and Red Phoenix's bold and unrestrained personality, the two of them became friends. Later, when the Archaic Treasure World opened, Red Phoenix took the initiative to invite Shi Hao to join her team to search for treasures. Although there were some geniuses from the upper realm who were unwilling to let Shi Hao join, Shi Hao still joined on account of Red Phoenix. When they wanted to enter the golden divine tree in the primordial treasure world, Shi Hao used the small world in his world treasure box to help the geniuses of the upper realm enter smoothly. When Red Phoenix was being pursued by the netherworld, Shi Hao was still the hero who saved her. Their relationship was very close, as if they were extremely good friends who had not seen each other for many years. It was not like Shi Hao and Yun Xi testing each other out, nor was it like the deep love between them and Huo Ling 'er. When Shi Hao was on his way to the Qin Clan in the lower realm, he met Red Phoenix and the others. Red Phoenix had a good impression of Shi Hao and was not stingy with her praises. She even expressed that she could bring Shi Hao to the higher realm. <a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
1 answer
2026-09-21 23:44
A novel about cruel officials
The following were novels related to cruel officials: " Horrible and Cruel Officials ", which told the story of the cruel officials 'experiences after being reborn as women. In addition, there was a story created by Lai Junchen, a cruel official of the Tang Dynasty. To a certain extent, it could also be regarded as novel material related to cruel officials. <a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
1 answer
2026-09-21 23:43
Transformers animation plot
On the planet of Cybertron in the distant universe, tens of millions of years ago, the five-faced monster developed military and civilian robots. The five-faced monster exploited the robots for profit or pleasure. As the robots continued to evolve, the five-faced monster was forced to escape from Cybertron due to the joint resistance of military and civilian robots. The robots gained independence and freedom. However, due to differences in concepts, war broke out between military products (Decepticons/Decepticons) and civilian products (autobots/autobots). The two sides fought for the rule of Cybertron in a protracted and ever-escalating war, during which they developed transformation technology. These robots were called Transformers. Millions of years of war had exhausted the resources of Cyberton. The autobots were led by the Prime in an ark to seek energy, while the Decepticons were followed by Megatron in a warship. The two sides fought fiercely in space, and two ships crashed to Earth. Millions of years later, volcanic eruptions activated the ship's self-repair system. The two factions were awakened on Earth and continued to compete with each other on Earth. Megatron initially attempted to seize the Earth's energy block and return to Cybertron to seize power. Later, he realized that Earth was rich in energy and made conquering Earth an important part of his conquest plan. He launched many schemes, such as seizing the Earth's core energy. Under the leadership of the Prime, the autobots fought alongside humans to defeat their schemes. During this period, new technologies were continuously applied to the war. There were many series of "Transformers" animation. In 30 years, there were 21 animated works and about 713 episodes (the content broadcasted in Japan and the United States was slightly different, and there were still new ones broadcasted). It was popular in the United States in 1984. It was broadcasted in Hong Kong around 1986 and caused a sensation. In 1988, it began to enter the mainland of China. In the animated version, the autobots and the Decepticons came from the planet Cyberton. During the war on the planet, the autobots were at a disadvantage and Cyberton was in a crisis. There was also a character like Long Worry in the animation. It was a member of the elite guards, lurking on Earth to monitor and collect intelligence. Its movement speed was proportional to its speech speed, and it could track down the world. "Transformers: Origins" was not enough. Everyone, please click to read the novel!
1 answer
2026-09-21 23:43
Reality is cruel, fantasy novels recommend female protagonists
The following are some fantasy novels that meet the requirements: - " I Changed Long Aotian's Script ": The female protagonist won everyone's respect and recognition with her own strong personality charm. She was different from her dream image. She was responsible and did not participate in the female competition. When the male protagonist was arrogant, she turned the tide and snatched the hearts of the female fans around the male protagonist. The little junior sister was initially hostile to the female protagonist and eventually became his fan. Her intention was grand. - " The Cultivation World Bans Species discrimination ": This is a hot-blooded story. The life experience of the female protagonist is the entry point of the story. The female protagonist and her friends have experienced many challenges together and finally succeeded in resisting their scumbag father. The story is set between a hot-blooded and honest disciple and a gentle master with a tail. - " Men Affect My Sword Practice ": A beautiful, strong, and miserable wooden female protagonist and a young male protagonist with superb intelligence. The male protagonist traveled from the real world to the cultivation world for the female protagonist. Over the long years, he only wanted to give the female protagonist a bright future. The book was filled with the sincere feelings of the young people. - [Men Affect the Speed of My Sword Drawing]: The female lead is unwavering, while the male lead is a pure sword spirit. The female protagonist realized that after she played for Long Aotian, she changed her fate and defeated the male protagonist to become the best in the world. The male protagonist was a sword forging genius. After he died and became a sword spirit, he followed the female protagonist and deeply admired her. Moreover, the female protagonist's sword was forged by the male protagonist. The male protagonist and the female protagonist's master were also related. - " The supporting actress refuses to follow the plot, the rich and powerful kneel down ": The novel is refreshing. After the female protagonist becomes a cannon fodder supporting actress, she refuses to follow the plot after discovering that the original matriarch's family has a lot of inheritance. In the early stage, Su Shuang slaps her face, and in the later stage, she seriously develops her career. She took back her inheritance and cut off all ties with the Lu family. She used her incense making ability to cooperate with the male protagonist of the King of Hell to create many projects, such as renting the haunted mall to ghosts to build a hell theme park. In the end, she became popular on the internet. <a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
1 answer
2026-09-21 23:43
Two-dimensional art game lesson plan design
The following is a two-dimensional art game lesson plan design example: ##1. Teaching objectives 1. ** Knowledge target ** - Let the students understand the basic elements of a 2D character, such as the head, body, hands and feet, etc. - To familiarize the students with the perspective principle of 2D character painting, so that they can use it to draw three-dimensional characters. - Help students master the basic color theory and use it to color 2D characters. 2. ** Skill Target ** - Students can use drawing tools like pencil, eraser, colored pencil, etc. - Students could complete the drawing of a 2D character independently, covering the entire process of composition, line drawing, and coloring. - Students could create a unique two-dimensional character according to their own preferences. 3. ** Emotions, attitudes, values, goals ** - Cultivate students 'interest and love for the 2D culture through the course. - To improve the students 'perception and creativity of artistic beauty, and at the same time cultivate patience, carefulness, observation and other qualities, enhance self-confidence and self-expression. ##2. Teaching content 1. ** Explanation of the basic composition of 2D characters ** - Using a typical 2D character as an example, he analyzed the proportion of the head (such as the proportion of the eyes, nose, mouth, and face), the shape of the body (the direction of the body lines under different styles), and the characteristics of the hands and feet (the performance of the hand gestures, the shape of the feet, etc.). 2. ** Teaching the principle of perspective ** - It introduced the application of one-point perspective and two-point perspective in the drawing of two-dimensional characters. For example, when drawing a character standing in a scene, how to use perspective to make the character feel three-dimensional, such as the body parts in the distance becoming relatively smaller, the convergence of lines, and so on. 3. ** Color theory and application ** - Explain the basic attributes of color (hue, lightness, purity), and how to choose the color that suits the character's personality and background in the 2D character painting. For example, warm colors were used for passionate characters, and cool colors were used for calm characters. At the same time, he taught the skills of color matching, such as the matching effect of complementary colors and adjacent colors. 4. ** Use of Drawing Tools ** - It introduced the characteristics of different drawing tools, such as the hardness of the pencil suitable for different stages of painting (soft lead is suitable for sketching, hard lead is suitable for sketching details), the color stacking effect of colored pencil, etc., and carried out practical operation demonstration. ##3. Teaching Method 1. ** Teaching Method ** - The teacher systematically explained the theoretical knowledge of the two-dimensional character painting, such as the composition elements, perspective principles, color theory, etc. 2. ** Demonstrating Method ** - The teacher demonstrated the steps of drawing the two-dimensional character on the blackboard or drawing tools, starting from the composition of the composition, gradually to the drawing of the line draft, coloring, etc., so that the students could see the drawing process intuitively. 3. ** Practice Method ** - Arrange for the students to practice painting and create two-dimensional characters according to the content taught by the teacher. During the practice, the teacher would guide the students and correct their mistakes in time. ##4. Teaching process 1. ** import (5 minutes)** - Show some famous 2D games or anime characters, such as the characters in Fate/Crown Position, Tomorrow's Ark, to arouse the students 'interest. Then ask the students how they feel about these characters, leading to the theme of this lesson-2D art game painting. 2. ** Knowledge explanation (20 minutes)** - According to the order of the teaching content, the basic composition of the two-dimensional character would be explained first, then the principle of perspective, color theory, and the use of drawing tools. Each part would be explained with pictures or simple drawing examples. 3. ** Demonstrate (15 minutes)** - The teacher chose a simple two-dimensional character to demonstrate the drawing. As he drew, he explained the key points of each step, such as paying attention to the position of the character in the picture when composing the composition, and the smoothness of the lines when drawing the sketch. 4. ** Student practice (30 minutes)** - The students began to create their own two-dimensional characters according to the teacher's demonstration and explanation. The teacher guided the students and answered their questions in time, such as questions about composition and color matching. 5. ** Exhibition and evaluation of works (20 minutes)** - Some of the students 'works were selected to be displayed, and the students were asked to introduce their creative ideas and difficulties in the painting process. Then, the teacher would evaluate the composition, character styling, color usage, and other aspects. At the same time, the teacher would encourage other students to evaluate and learn from each other. ##5. Extension of Teaching 1. Arrange homework for students to create a more complex 2D character according to what they have learned in this class. They are also required to write the background story of the character to train the students 'comprehensive creative ability. 2. He recommended some learning resources for two-dimensional painting, such as websites and books, for students to study further after class. <a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
1 answer
2026-09-21 23:43
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z