LeetCode 30.10.2022|Mastering QuickSort and Partition Function in Python
Join us: https://discord.gg/sZkePhaWSZ.
---
The group is discussing the QuickSort algorithm and the need to write a Partition function for a homework assignment on sorting algorithms. They mention the concept of finding the kth largest element in an array using QuickSort. The conversation is somewhat disjointed and difficult to follow, with some members expressing uncertainty about their ability to complete the assignment. They consider using a Python implementation and discuss the process of sorting elements in an array using the Partition function. The group struggles with understanding the Partition function and its output, with some members suggesting that it mutates the array rather than returning a new one. They attempt to run a Python implementation of the function and discuss the results, trying to understand why it is not sorting the array correctly. Despite some confusion, the group eventually makes progress and is able to sort the array using QuickSort. They also discuss the need to compare the index returned by the Partition function with the desired element, which may be the kth largest element in the array. They consider how to handle cases where there are multiple elements with the same value, and whether to count from the beginning or end of the array. The group also discusses the possibility of using the Partition function to solve a related problem involving finding the kth order statistic in an array. They discuss the importance of correctly handling cases where the desired element is not in the middle of the array, and how to adjust the index accordingly. They also discuss the need to handle cases where the array contains duplicate elements, and how to handle ties when multiple elements have the same value. Additionally, there are some unrelated conversations in a different language that are not relevant to the main discussion. The group also discusses a separate programming problem involving manipulating strings and using a hash table to store results. They discuss the need to pass an index to the function and how to handle cases where the index is at the end of a word. They also discuss the importance of initializing the hash table and avoiding overwriting previous results. There is some confusion about the implementation, but the group eventually makes progress and is able to get the program to work.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «LeetCode 30.10.2022|Mastering QuickSort and Partition Function in Python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.