Posts

Showing posts with the label algorithm

Swift Algorithm

If you're new to algorithms and data structures, here are a few good ones to start out with: Stack Queue Insertion Sort Binary Search  and  Binary Search Tree Merge Sort Boyer-Moore string search The algorithms Searching Linear Search . Find an element in an array. Binary Search . Quickly find elements in a sorted array. Count Occurrences . Count how often a value appears in an array. Select Minimum / Maximum . Find the minimum/maximum value in an array. k-th Largest Element . Find the  k -th largest element in an array, such as the median. Selection Sampling . Randomly choose a bunch of items from a collection. Union-Find . Keeps track of disjoint sets and lets you quickly merge them. String Search Brute-Force String Search . A naive method. Boyer-Moore . A fast method to search for substrings. It skips ahead based on a look-up table, to avoid looking at every character in the text. Rabin-Karp Longest Common Subsequence . Find the longest se...