Quick sort leetcodeQuicksort 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.
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.
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.
What does the secret book to save girls mean?Esoterica " meant a secret book or method that was not known to the public. It usually contained unique and precious techniques or strategies that could help people gain an advantage or success in a specific field. However, the expression " secret to saving girls " lacked more context and was difficult to define. If taken literally, it might be a unique, unknown method or strategy to save girls.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Fast Hand photography softwareThe official photography software launched by Fast Hand was the Yitian camera app. It had a variety of features such as high-sweetness Japanese and Korean filter, vitality sticker, natural lightweight beauty, and so on. It could quickly take beautiful photos. The software also supported blurring the photo, so a simple smear could create a depth of field effect. At the same time, it provided Short videos and photos, which could be shared on third-party social media such as fast-hand, circle of friends, and Weibo. In addition, there was also the Kuaiying video editing app. Although its main function was video editing, it also integrated many beautiful filter effects to help users shoot Hollywood blockbuster videos. It also had a powerful intelligent voice recognition function that could automatically generate subtitles, and a massive music library that could be used to create customized and interesting original videos.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
What kind of camera lens should I add to my phone to take pictures of pets?Different phones with different lenses had their own advantages when shooting pets. For example, the Oppo Find X6 Pro did not mention a specific lens, but it might have a function suitable for taking pets; the Pikfang pet photography robot had a telephoto and wide-angle lens, and its telephoto lens had a 3x zoom optical shot to make the picture more realistic. The Huawei P60 Pro uses a long-line sliding axis zoom lens group, which can flexibly control the focusing distance and achieve clear imaging from far to macro. Its telephoto macro has obvious advantages when shooting pets. It can take clear photos without disturbing the subject. The Oppo Reno10 Pro+ was equipped with a super-light periscope telephoto lens with 64 million pixels and a 1/2-inch large base. The pet picture was delicate and had good tolerance. It could capture the details of the fur, and the dark and bright parts retained enough details. The 3x optical zoom, the rare suspension prism anti-shake and fast focusing speed at the price of 3 - 4K made it have a high filming rate. The color processor could also restore the color of the pet's fur, nose and eyes. Therefore, if you use a mobile phone to shoot pets, you can consider a mobile phone with a telephoto lens (such as a sliding axis zoom lens group, a super-light periscope telephoto lens, etc.) to get better shooting results.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Reborn Xiangjiang Harem novel recommended female protagonistThe following are some recommendations for the female protagonists of the novels:
- "The wife of the richest man in Xiangjiang (80)": The female protagonist Qin Xiang was reborn in the 1980s. She was once envied by others for her happy life but suffered double betrayal. After her rebirth, she only wanted to make money. In this era where a pig could take off even if it stood in the wind, she kicked the scumbag to start a career. As she earned more and more money, the new technology upstart of Harbor City, Meng Huaiqing, started to pursue her. In the end, Meng Huaiqing became the richest man in Harbor City and the female lead even manipulated the stock market, causing everyone to marvel.
- "Rich! Xiangjiang's Genius Master Chef Mother ": The female protagonist, Qin Shuangshu, transmigrated into the book and became the wife of the cannon fodder in the book" 90 Xiangjiang Business Tycoon ". The original book set her fate to be tragic. After she came back, she faced the bad gambler's husband beating up her mother and son, robbing her of the money to buy vegetables, and other messes. She kicked the bad gambler away, and with the fragrant pig fat residue, she unexpectedly became famous, changing the fate of herself and her son. She conquered Xiangjiang Studios with delicious food, changed the tragic fate of many characters in the book, and started her career as a food stall.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Reborn protagonist Li Yi, Tang Xue's novel is free to read" Rebirth 1980: Marrying Sister's Best Friend at the Beginning " was a novel with Li Yi and Tang Xue as the main characters. When Li Yi was reborn and returned to the small mountain village in 1980, he did not hesitate to agree to Tang Xue's request to marry him. In his previous life, he failed to protect Tangxue, causing her to fall into darkness. After his rebirth, he was determined to make Tangxue the happiest woman in the world, and at the same time, he wanted to become the protagonist of this era. The plot of this novel is full of ups and downs, exciting, and well-written. Some websites provide free online reading services for this novel.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
What are the names of the novels about the reborn woman as a merchant?The following were novels written by women who had been reborn as businessmen: "80's Wealth Begins from Making Colorful Lights","The Wife of the Richest Man in Xiangjiang (80)", and "80's Early Death After His Ex-Wife Reborn".
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>