Batcher Sort
   HOME



picture info

Batcher Sort
Bitonic mergesort is a parallel algorithm for sorting. It is also used as a construction method for building a sorting network. The algorithm was devised by Ken Batcher. The resulting sorting networks consist of O(n\log^2(n)) comparators and have a delay of O(\log^2(n)), where n is the number of items to be sorted. This makes it a popular choice for sorting large numbers of elements on an architecture which itself contains a large number of parallel execution units running in lockstep, such as a typical GPU. A sorted sequence is a monotonically non-decreasing (or non-increasing) sequence. A ''bitonic'' sequence is a sequence with x_0 \leq \cdots \leq x_k \geq \cdots \geq x_ for some k, 0 \leq k arr OR (bitwiseAND (i, k) != 0) AND (arr < arr ) swap the elements arr and arr
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Sorting Algorithm
In computer science, a sorting algorithm is an algorithm that puts elements of a List (computing), list into an Total order, order. The most frequently used orders are numerical order and lexicographical order, and either ascending or descending. Efficient sorting is important for optimizing the Algorithmic efficiency, efficiency of other algorithms (such as search algorithm, search and merge algorithm, merge algorithms) that require input data to be in sorted lists. Sorting is also often useful for Canonicalization, canonicalizing data and for producing human-readable output. Formally, the output of any sorting algorithm must satisfy two conditions: # The output is in monotonic order (each element is no smaller/larger than the previous element, according to the required order). # The output is a permutation (a reordering, yet retaining all of the original elements) of the input. Although some algorithms are designed for sequential access, the highest-performing algorithms assum ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Locality Of Reference
In computer science, locality of reference, also known as the principle of locality, is the tendency of a processor to access the same set of memory locations repetitively over a short period of time. There are two basic types of reference locality temporal and spatial locality. Temporal locality refers to the reuse of specific data and/or resources within a relatively small time duration. Spatial locality (also termed ''data locality'')"NIST Big Data Interoperability Framework: Volume 1"urn:doi:10.6028/NIST.SP.1500-1r2 refers to the use of data elements within relatively close storage locations. Sequential locality, a special case of spatial locality, occurs when data elements are arranged and accessed linearly, such as traversing the elements in a one-dimensional Array data structure, array. Locality is a type of predictability, predictable behavior that occurs in computer systems. Systems which exhibit strong ''locality of reference'' are good candidates for performance optimiza ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Pairwise Sorting Network
The pairwise sorting network is a sorting network In computer science, comparator networks are abstract devices built up of a fixed number of "wires", carrying values, and comparator modules that connect pairs of wires, swapping the values on the wires if they are not in a desired order. Such ne ... discovered and published by Ian Parberry in 1992 in '' Parallel Processing Letters''. The pairwise sorting network has the same size (number of comparators) and depth as the odd–even mergesort network. At the time of publication, the network was one of several known networks with a depth of O(\log^2 n). It requires n(\log n)(\log n - 1)/4 + n - 1 comparators and has depth (\log n)(\log n + 1)/2. The sorting procedure implemented by the network is as follows (guided by the zero-one principle): # Sort consecutive pairwise bits of the input (corresponds to the first layer of the diagram) # Sort all pairs into lexicographic order by recursively sorting all odd bits and even bits sepa ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Batcher Odd–even Mergesort
Batcher's odd–even mergesort is a generic construction devised by Ken Batcher for sorting networks of size O(''n'' (log ''n'')2) and depth O((log ''n'')2), where ''n'' is the number of items to be sorted. Although it is not asymptotically optimal, Donald Knuth, Knuth concluded in 1998, with respect to the Sorting network#Optimal sorting networks, AKS network that "Batcher's method is much better, unless ''n'' exceeds the total memory capacity of all computers on earth!" It is popularized by the second ''GPU Gems'' book, as an easy way of doing reasonably efficient sorts on graphics-processing hardware. Pseudocode Various recursive and iterative schemes are possible to calculate the indices of the elements to be compared and sorted. This is one iterative technique to generate the indices for sorting n elements: # note: the input sequence is indexed from 0 to (n-1) for p = 1, 2, 4, 8, ... # as long as p = 1 for j = mod(k,p) to (n-1-k) with a step size of 2k ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Butterfly Network
Butterflies are winged insects from the lepidopteran superfamily Papilionoidea, characterized by large, often brightly coloured wings that often fold together when at rest, and a conspicuous, fluttering flight. The oldest butterfly fossils have been dated to the Paleocene, about 56 million years ago, though molecular evidence suggests that they likely originated in the Cretaceous. Butterflies have a four-stage life cycle, and like other holometabolous insects they undergo complete metamorphosis. Winged adults lay eggs on the food plant on which their larvae, known as caterpillars, will feed. The caterpillars grow, sometimes very rapidly, and when fully developed, pupate in a chrysalis. When metamorphosis is complete, the pupal skin splits, the adult insect climbs out, expands its wings to dry, and flies off. Some butterflies, especially in the tropics, have several generations in a year, while others have a single generation, and a few in cold locations may take several ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  



MORE