Michael Pipermichaelpiper.hashnode.dev·an hour agoBasic Sorting Algorithms in Dart: A Comprehensive GuideSorting is a fundamental concept in computer science and programming. In Dart, implementing basic sorting algorithms helps you understand how data can be arranged in a specific order. This guide covers several fundamental sorting algorithms and provi...Discussalgorithms
Tapan Rachchhtapanrachchh.hashnode.dev·Jul 23, 20241636. Sort Array by Increasing Frequencyclass Solution: def frequencySort(self, nums: List[int]) -> List[int]: c = Counter(nums) v = [x[0] for x in sorted(c.items(), key=lambda x:(x[1], -1 * x[0]))] ans = [] for num in v: ans += [nu...Discussleetcode
Lingyun Dailingyundai.hashnode.dev·Jul 9, 2024All About Sorting Algorithms - Part 2 - Merge SortIn this article, we will discuss one of the main sorting algorithms that every software engineer should know: merge sort. I will explain the algorithm based on what I have learned. I hope you will learn something from the article. Let me know what yo...Discussalgorithms
Rahul Dasurahuldasu.hashnode.dev·Jul 1, 2024Understanding Bubble Sort: The Simple Yet Powerful Sorting AlgorithmSorting algorithms are a fundamental part of computer science, enabling us to organize data efficiently. Among these algorithms, Bubble Sort stands out for its simplicity and educational value. While not the most efficient for large datasets, it prov...Discusssorting
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 26, 2024Bucket SortBucket Sort is a sorting algorithm that splits the unsorted array into groups called buckets. Each bucket is then sorted. How it works Put elements into the buckets Sort the elements in each bucket Collect elements from each bucket Code def buck...DiscussAlgorithmsDSA
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 26, 2024Radix SortThe Radix Sort algorithm sorts an array by each digit, starting with the rightmost digit, and usually works with positive numbers. How it works Start with the least significant digit (rightmost digit). Sort the values based on the digit in focus by...DiscussAlgorithmsDSA
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 26, 2024Counting SortThe Counting Sort algorithm sorts an array by counting how often each value appears. How it works Create a new array to count the different values. Go through the array that needs sorting. For each value, increase the count in the counting array a...DiscussAlgorithmsDSA
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 25, 2024Quick SortAs the name suggests, Quicksort is one of the fastest sorting algorithms. The pivot element is placed between a sub-array with lower values on the left side and a sub-array with higher values on the right side. The algorithm calls itself twice, onc...DiscussAlgorithmsDSA
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 25, 2024Insertion SortThe Insertion Sort algorithm divides the array into a sorted part and an unsorted part. We assume the first item is already sorted, then we pick an unsorted item. If the unsorted item is greater than the item in hand, it goes to the right; otherwise...DiscussAlgorithmsPython
Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 25, 2024Understanding the Cyclic Sort algorithmCyclic Sort is a specialized sorting algorithm that is particularly useful for sorting arrays where each element is in the range from 1 to n (or 0 to n-1), and each element appears exactly once or is missing at most one element. The algorithm works b...Discusscycle-sort