• Title/Summary/Keyword: Insertion sort

Search Result 10, Processing Time 0.024 seconds

Analysis and Comparison of Sorting Algorithms (Insertion, Merge, and Heap) Using Java

  • Khaznah, Alhajri;Wala, Alsinan;Sahar, Almuhaishi;Fatimah, Alhmood;Narjis, AlJumaia;Azza., A.A
    • International Journal of Computer Science & Network Security
    • /
    • v.22 no.12
    • /
    • pp.197-204
    • /
    • 2022
  • Sorting is an important data structure in many applications in the real world. Several sorting algorithms are currently in use for searching and other operations. Sorting algorithms rearrange the elements of an array or list based on the elements' comparison operators. The comparison operator is used in the accurate data structure to establish the new order of elements. This report analyzes and compares the time complexity and running time theoretically and experimentally of insertion, merge, and heap sort algorithms. Java language is used by the NetBeans tool to implement the code of the algorithms. The results show that when dealing with sorted elements, insertion sort has a faster running time than merge and heap algorithms. When it comes to dealing with a large number of elements, it is better to use the merge sort. For the number of comparisons for each algorithm, the insertion sort has the highest number of comparisons.

Finding the Worst-case Instances of Some Sorting Algorithms Using Genetic Algorithms (유전 알고리즘을 이용한 정렬 알고리즘의 최악의 인스턴스 탐색)

  • Jeon, So-Yeong;Kim, Yong-Hyuk
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2010.06b
    • /
    • pp.1-5
    • /
    • 2010
  • 정렬 알고리즘에서 사용한 원소 간 비교횟수를 기준으로, 비교횟수가 많게 되는 순열을 최악의 인스턴스(worst-case instance)라 명명하고 이를 찾기 위해 유전 알고리즘(genetic algorithm)을 사용하였다. 잘 알려진 퀵 정렬(quick sort), 머지 정렬(merge sort), 힙 정렬(heap sort), 삽입 정렬(insertion sort), 쉘 정렬(shell sort), 개선된 퀵 정렬(advanced quick sort)에 대해서 실험하였다. 머지 정렬과 삽입 정렬에 대해 탐색한 인스턴스는 최악의 인스턴스에 거의 근접하였다. 퀵 정렬은 크기가 증가함에 따라 최악의 인스턴스 탐색이 어려웠다. 나머지 정렬에 대해서 찾은 인스턴스는 최악의 인스턴스인지 이론적으로 보장할 수 없지만, 임의의 1,000개 순열을 정렬해서 얻은 비교횟수들의 평균치보다는 훨씬 높았다. 본 논문의 최악의 인스턴스를 탐색하는 시도는 알고리즘의 성능 검증을 위한 테스트 데이터를 생성한다는 점에서 의미가 크다.

  • PDF

Design of Learning Courses of Sorting Algorithms using LAMS

  • Yoo, Jae-Soo;Seong, Dong-Ook;Park, Yong-Hun;Lee, Seok-Jae;Yoo, Kwan-Hee;Cho, Ja-Yeon
    • International Journal of Contents
    • /
    • v.4 no.1
    • /
    • pp.20-25
    • /
    • 2008
  • The development of communication technology and the spread of computers and internet have affected to the field of education. In this paper, we design a learning process with LAMS to make the new education environment which is required in an information age. We made the learning environment with LAMS which develops the learner's algorithmic thinking faculty on some sorting algorithm, especially such as selection sort, bubble sort and insertion sort algorithm. In addition, we analyse the effectiveness of the learning environment. The designed contents were applied to elementary school students' learning and a questionnaire survey was conducted after a learning course. The research of the questionnaire shows that the learning system using LAMS motivates a learner for learning and provides a convenient learning environment.

Sorting Cuckoo: Enhancing Lookup Performance of Cuckoo Hashing Using Insertion Sort (Sorting Cuckoo: 삽입 정렬을 이용한 Cuckoo Hashing의 입력 연산의 성능 향상)

  • Min, Dae-hong;Jang, Rhong-ho;Nyang, Dae-hun;Lee, Kyung-hee
    • The Journal of Korean Institute of Communications and Information Sciences
    • /
    • v.42 no.3
    • /
    • pp.566-576
    • /
    • 2017
  • Key-value stores proved its superiority by being applied to various NoSQL databases such as Redis, Memcached. Lookup performance is important because key-value store applications performs more lookup than insert operations in most environments. However, in traditional applications, lookup may be slow because hash tables are constructed out of linked-list. Therefore, cuckoo hashing has been getting attention from the academia for constant lookup time, and bucketized cuckoo hashing (BCH) has been proposed since it can achieve high load factor. In this paper, we introduce Sorting Cuckoo which inserts data using insertion sort in BCH structure. Sorting Cuckoo determines the existence of a key with a relatively small memory access because data are sorted in each buckets. In particular, the higher memory load factor, the better lookup performance than BCH's. Experimental results show that Sorting Cuckoo has smaller memory access than BCH's as many as about 19 million (25%) in 10 million negative lookup operations (key is not in the table), about 4 million times (10%) in 10 million positive lookup operations (where it is) with load factor 95%.

A Fast Sorting Strategy Based on a Two-way Merge Sort for Balancing the Capacitor Voltages in Modular Multilevel Converters

  • Zhao, Fangzhou;Xiao, Guochun;Liu, Min;Yang, Daoshu
    • Journal of Power Electronics
    • /
    • v.17 no.2
    • /
    • pp.346-357
    • /
    • 2017
  • The Modular Multilevel Converter (MMC) is particularly attractive for medium and high power applications such as High-Voltage Direct Current (HVDC) systems. In order to reach a high voltage, the number of cascaded submodules (SMs) is generally very large. Thus, in the applications with hundreds or even thousands of SMs such as MMC-HVDCs, the sorting algorithm of the conventional voltage balancing strategy is extremely slow. This complicates the controller design and increases the hardware cost tremendously. This paper presents a Two-Way Merge Sort (TWMS) strategy based on the prediction of the capacitor voltages under ideal conditions. It also proposes an innovative Insertion Sort Correction for the TWMS (ISC-TWMS) to solve issues in practical engineering under non-ideal conditions. The proposed sorting methods are combined with the features of the MMC-HVDC control strategy, which significantly accelerates the sorting process and reduces the implementation efforts. In comparison with the commonly used quicksort algorithm, it saves at least two-thirds of the sorting execution time in one arm with 100 SMs, and saves more with a higher number of SMs. A 501-level MMC-HVDC simulation model in PSCAD/EMTDC has been built to verify the validity of the proposed strategies. The fast speed and high efficiency of the algorithms are demonstrated by experiments with a DSP controller (TMS320F28335).

Evaluation of Bone Uptake on Tc-99m-MDP in Immediate and Delayed Dental Implants (즉시형과 지연형 치아 임플란트에서 Tc-99m-MDP의 Bone Uptake 평가)

  • 김중현;김명환;이원국;이재영;강성수;최석화
    • Journal of Veterinary Clinics
    • /
    • v.20 no.2
    • /
    • pp.207-211
    • /
    • 2003
  • This investigation aimed to determine the relative merit of osseointegration in immediate and delayed implantation in the dog mandible using radiography and bone scintigraphy. five adult mongrel dogs with a mean weight of 8.5 kg were used in this investigation. During the entire study period. all dogs were fed with a soft commercial diet and water ad libitum to minimize functional loading of the implant. Twenty titanium alloy systems 4 mm in diameter and 10 mm in length blasted with calcium phosphate were prepared for insertion. The second and third left mandibular premolars in each dog were extracted for the delayed implant insertion. Twelve weeks later, the second and third right mandibular premolars were extracted for the immediate implant insertion. Before the delayed and immediate implantation procedures and 0, 4, 8, and 12 weeks after the insertions, radiography and bone scintigraphy were conducted. Bone scans were obtained using a large field of view gamma camera equipped with a collimator about 3 hours after intravenous injection of Tc-99m-MDP to the dogs. All the dogs were evaluated weekly for inflammation, necrosis, and other of the bone or sort tissue. Significant macroscopic lesions were not detected. Radioisotope scintigraphy with Tc-99m-MDP hat proved to be a reliable method for measuring increased bone activity at specific skeleton tissue sites. In conclusion, osseointegration in peri-implant bone did not differ significantly between the immediate and delayed implant procedures during the experimental period. The immediate implant may be an alternative treatment of implant insertion in animals.

Probabilistic analysis of efficiencies for sorting algorithms with a finite number of records based on an asymptotic algorithm analysis (점근적 분석 모형에 기초한 유한개 레코드 정렬 알고리즘 효율성의 확률적 분석)

  • 김숙영
    • Journal of the Korea Computer Industry Society
    • /
    • v.5 no.2
    • /
    • pp.325-330
    • /
    • 2004
  • The Big O notation of a sorting algorithm analysis is an asymptotic algorithm analysis which gives information of a rough mathematical function with an infinite increase of a sample size, without any specification of a probabilistic model. Hence. in an application with a limited finite number of data, it is necessary to test efficiencies of sorting algorithms. I estimated probabilistic models which analyze the number of exchanges varying input sizes to sort. The estimated models to explain the relationship of sorting efficiency on the sample size (N of the sample size and S of the number of exchange of elements) are S=0.9305 $N^{1.339}$ for Quick sort algorithm with O(nlogn) time complexity, and S=0.2232 $N^{2.0130}$ for Insertion sort algorithm with O( $n^2$) time complexity. Furthermore, there are strongly supports that more than 99% of the above relationship could be explained by the estimated models (p<0.001). These findings suggest it is necessary to analyze sorting algorithm efficiency in applications with a finite number of data or a newly developed sorting algorithm.

  • PDF

Low-Complexity Soft-MIMO Detection Algorithm Based on Ordered Parallel Tree-Search Using Efficient Node Insertion (효율적인 노드 삽입을 이용한 순서화된 병렬 트리-탐색 기반 저복잡도 연판정 다중 안테나 검출 알고리즘)

  • Kim, Kilhwan;Park, Jangyong;Kim, Jaeseok
    • The Journal of Korean Institute of Communications and Information Sciences
    • /
    • v.37A no.10
    • /
    • pp.841-849
    • /
    • 2012
  • This paper proposes an low-complexity soft-output multiple-input multiple-output (soft-MIMO) detection algorithm for achieving soft-output maximum-likelihood (soft-ML) performance under max-log approximation. The proposed algorithm is based on a parallel tree-search (PTS) applying a channel ordering by a sorted-QR decomposition (SQRD) with altered sort order. The empty-set problem that can occur in calculation of log-likelihood ratio (LLR) for each bit is solved by inserting additional nodes at each search level. Since only the closest node is inserted among nodes with opposite bit value to a selected node, the proposed node insertion scheme is very efficient in the perspective of computational complexity. The computational complexity of the proposed algorithm is approximately 37-74% of that of existing algorithms, and from simulation results for a $4{\times}4$ system, the proposed algorithm shows a performance degradation of less than 0.1dB.

Research on the well-being-centric green building certification - Focused on AHP Analysis of Expert Survey in order to introduce well-being criteria - (웰빙 중심 친환경 건축인증을 위한 연구 - 웰빙항목 도입을 위한 전문가 AHP 분석을 중심으로 -)

  • Nam, Hye-Ryeong;Lee, Byung-Yun
    • KIEAE Journal
    • /
    • v.16 no.6
    • /
    • pp.29-38
    • /
    • 2016
  • Purpose: This study is conducted to contribute to the improvement of Green Standard for Energy and Environmental Design(G-SEED) from the existing energy physical efficiency-centric system to the well-being-centric green building certification system. Method: In order to modify existing G-SEED Certification, three phases of research have been conducted; 1) identification of needs of well-being-centric environment-friendly construction certification system, 2) comparison of domestic certification system with WELL Building standard(WELL) which focuses on human health and promotion of wellness and 3) AHP analysis to sort out the supplement items from WELL. Result: We proposed four alternatives which should be preferentially introduced to the existing domestic certification system; addition of independent 'well-being' section(field) in G-SEED, insertion of 'well-being' indicators in each relevant section of G-SEED, addition of 'well-being' indicators in 'Innovative Design(ID)' of G-SEED and independent score systems for 25 items in a high priority.

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.