• Title/Summary/Keyword: Quicksort

Search Result 11, Processing Time 0.024 seconds

An Implementation of Efficient Quicksort Utilizing SIMD-Based VBP Technique (SIMD 기반의 VBP 기법을 적용한 효율적인 퀵정렬의 구현)

  • Hong, Gilseok;Kim, Hongyeon;Kang, Seonghyeon;Min, Jun-Ki
    • KIISE Transactions on Computing Practices
    • /
    • v.23 no.8
    • /
    • pp.498-503
    • /
    • 2017
  • SIMD (Single Instruction Multiple Data) is a representative parallelization architecture that processes multiple data loaded in a SIMD register with a single instruction. Quicksort is a sorting algorithm that picks an element as a pivot from the array and reorders the array such that all elements having the values less than the pivot value are located in the left side on the pivot as well as all elements having the value greater than the pivot value are located in the right side on the pivot and then the algorithm performs the same task on both sublist recursively. In this paper, we propose an efficient Quicksort algorithm applying the SIMD instructions which minimally invokes conditional branches to avoid the performance degradation incurred by branch misprediction in a pipeline architecture. In addition, we improve the performance of the Quicksort algorithm by fetching data into a SIMD register as a byte unit to apply VBP (Vertical Bit Parallel) and the early pruning technique.

3-Points Average Pivot Quicksort (3-점 평균 피벗 퀵정렬)

  • Lee, Sang-Un
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.14 no.6
    • /
    • pp.295-301
    • /
    • 2014
  • In the absence of a sorting algorithm faster than O(n log n), Quicksort remains the best and fastest of its kind in practice. For given n data, Quicksort records running in O(n log n) at best and $O(n^2)$ at its worst. In this paper, I propose an algorithm by which 3-points average P=(L+M+H)/3 is set as a pivot for first array L=a[s], last array H=a[e], and middle array $M=a[{\lfloor}(s+e)/2{\rfloor}]$ in order to find the more fast than Quicksort. Test results prove that the proposed 3-points average pivot Quicksort has the time complexity of O(n log n) at its best, average, and worst cases. And the proposed algorithm can be reduce the $O(n^2)$ time of Quicksort to O(n log n).

Sorting $\kappa^-mer$ Table in DNA Fragment Assembly (DNA Fragment Assembly에서$\kappa^-$글자 테이블의 정렬)

  • 홍순철;박근수
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2002.10c
    • /
    • pp.733-735
    • /
    • 2002
  • DNA fragment assembly 프로그램인 Phrap에서는 exact match를 찾기 위해 정렬된 k-글자 테이블 자료구조를 사용한다. 이것은 접미사 배열의 간단한 형태로서, DNA fragment assembly와 같은 응용에서는 접미사 배열보다 더 유용한 자료구조이다. 본 논문에서는 k-글자 테이블을 정렬하는 Manber-Myers, Quicksort, Radix sort 알고리즘을 살펴보고, 실험을 통해 그 중에서 가장 뛰어난 성능을 가지는 것이 Quicksort 알고리즘임을 보였다 또한 k-글자 테이블의 정렬 문제에 있어서는, 캐쉬-메모리 아키텍쳐에 최적화되어 계산복잡도 속에 숨어있는 상수를 최소화하는 것이 중요한 문제임을 밝힌다.

  • PDF

Proposal of Fast Counting Sort (빠른 계수 정렬법의 제안)

  • Lee, Sang-Un
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.15 no.5
    • /
    • pp.61-68
    • /
    • 2015
  • Among comparison sorts, no algorithm excels a current set lower bound of O(nlogn) in operation. Quicksort, the fastest of its kind, has a complexity of O(nlogn) at its best and on average and $O(n^2)$ at worst. This paper thus presents two methods: first is an O(n+k) simple counting sort which operates much more speedily than an O(n+k), (k=maximum value) counting sort, and second is an O(ln) radix counting sort which counts the frequency of numbers in the digit l of a data and saves it in a corresponding virtual bucket in an array, only to virtually divide the array into radix digit numbers. For the 6 experimental data, the proposed algorithm makes O(nlogn) or $O(n^2)$ of Quicksort simple into O(n+k) or O(ln). After all, the proposed sorting algorithm has proved to be much faster than the counting sort and Quicksort.

Quicksort Using Range Pivot (범위 피벗 퀵정렬)

  • Lee, Sang-Un
    • Journal of the Korea Society of Computer and Information
    • /
    • v.17 no.4
    • /
    • pp.139-145
    • /
    • 2012
  • Generally, Quicksort selects the pivot from leftmost, rightmost, middle, or random location in the array. This paper suggests Quicksort using middle range pivot $P_0$ and continually divides into 2. This method searches the minimum value $L$ and maximum value $H$ in the length n of list $A$. Then compute the initial pivot key $P_0=(H+L)/2$ and swaps $a[i]{\geq}P_0$,$a[j]<P_0$ until $i$=$j$ or $i$>$j$. After the swap, the length of list $A_0$ separates in two lists $a[1]{\leq}A_1{\leq}a[j]$ and $a[i]{\leq}A_2{\leq}a[n]$ and the pivot values are selected by $P_1=P_0/2$, $P_2=P_0+P_1$. This process repeated until the length of partial list is two. At the length of list is two and $a$[1]>$a$[2], swaps as $a[1]{\leftrightarrow}a[2]$. This method is simpler pivot key process than Quicksort and improved the worst-case computational complexity $O(n^2)$ to $O(n{\log}n)$.

Parallel Sorting Algorithm by Median-Median (중위수의 중위수에 의한 병렬 분류 알고리즘)

  • Min, Yong-Sik
    • The Journal of the Acoustical Society of Korea
    • /
    • v.14 no.1E
    • /
    • pp.14-21
    • /
    • 1995
  • This paper presents a parallel sorting algorithm suitable for the SIMD multiprocessor. The algorithm finds pivots for partitioning the data into ordered subsets. The data can be evenly distributed to be sorted since it uses the probability theory. For n data elements to be sorted on p processors, when $n{\geq}p^2$, the algorithm is shown to be asymptotically optimal. In practice, sorting 8 million data items on 64 processors achieved a 48.43-fold speedup, while the PSRS required a 44.4-fold speedup. On a variety of shared and distributed memory machines, the algorithm achieved better than half-linear speedups.

  • PDF

Virtual Radix Counting Bucket sort (가상의 기수계수버킷 정렬)

  • Lee, Sang-Un
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.15 no.6
    • /
    • pp.95-102
    • /
    • 2015
  • Generally, there is no sorting algorithm much faster than O(nlogn). The quicksort has a best performance O(nlogn) in best and average-case, and $O(n^2)$ in worst-case. This paper suggests virtual radix counting bucket sort such that counting the frequency of numbers in each radix digit, and moves the arbitrary number to proper virtual bucket in the array, and divides the array into radix digit numbers virtually. Also, this algorithm moves the data to proper location within an array for using the minimum auxiliary memory. This algorithm performs k-times such that the number of k digits in given data and the time complexity is O(n). Therefore, this algorithm has a O(kn) time complexity.

Implementation and Performance Evaluation of a Tightly-Coupled Multiprocessor System (밀결합 멀티프로세서 시스템의 구현 및 성능평가)

  • 김덕진;김영천;박석천
    • Journal of the Korean Institute of Telematics and Electronics
    • /
    • v.24 no.5
    • /
    • pp.777-785
    • /
    • 1987
  • In this paper, a tightly-coupled multiprocessor system is implemented with four processing elements based on MC68000 CPU, a common menory (128KB), and a single time-shared bus. The multi-tasking operating system, MTOS, is modified so that the multiprocessor system can support multitasking and multiprocessing. The performance of the proposed system is evaluated by stochastic Petri Net system modeling. The efficiency and the processing power are simulated for various load factors and up to 16 PEs. By running benchmark programs, such as quicksort, FFT, and matrix-multiplication, the speed of parallel processing is compared with that of a single processor.

  • PDF

UTILIZING WEAK 𝜓 - 𝜑 CONTRACTION ON FUZZY METRIC SPACES

  • Amrish Handa
    • The Pure and Applied Mathematics
    • /
    • v.30 no.3
    • /
    • pp.309-336
    • /
    • 2023
  • We establish some common fixed point theorems satisfying weak ψ - ϕ contraction on partially ordered non-Archimedean fuzzy metric spaces. By using this results we show the existence of fixed point on the domain of words and apply this approach to deduce the existence of solution for some recurrence equations associated to the analysis of Quicksort algorithms and divide and Conquer algorithms, respectively and also give an example to show the usefulness of our hypothesis. Our results generalize, extend and improve several well-known results of the existing literature in fixed point theory.

An Experimental Analysis on the Unplugged Sorting Activity for Computer Science Education (컴퓨터과학 교육용 정렬 놀이를 위한 실험적 분석)

  • Park, Youngki
    • Journal of The Korean Association of Information Education
    • /
    • v.22 no.6
    • /
    • pp.671-679
    • /
    • 2018
  • Sorting algorithms are the basic building blocks that computer science students need to learn. In recent years, sorting algorithms also have begun to be taught in K-12 classrooms using "the educational sorting game" described in CSUnplugged. However, although the educational sorting game was developed for students aged 8 and up, it is hard for K-12 teachers to play with their students because it is difficult for teachers to understand all of the algorithms and some popular algorithms do not work well in the educational sorting game. In this paper, we discuss what teachers should know, and experimentally analyze the performance of the existing algorithms when applied to the educational sorting game.