Unlock instant, AI-driven research and patent intelligence for your innovation.

Computer internal sorting method for two-way alternate hhalving insertion sorting

A technology of half-insertion and sorting method, which is applied in the computer internal sorting field of two-way alternate half-insertion sorting, can solve the problems of reducing the number of sorting times, and the efficiency of 2-way insertion sorting is affected by the boundary elements, so as to reduce the number of data comparisons and reduce the number of data The effect of reducing the number of movement times and data movement times

Pending Publication Date: 2021-03-09
GUIZHOU RADIO & TV UNIV +2
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Aiming at the deficiencies of the prior art, the present invention provides a computer internal sorting method for two-way alternate half-insertion sorting, which has the advantages of reducing the number of sorting times, and solves the problem that the efficiency of 2-way insertion sorting is affected by the boundary elements

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Computer internal sorting method for two-way alternate hhalving insertion sorting
  • Computer internal sorting method for two-way alternate hhalving insertion sorting
  • Computer internal sorting method for two-way alternate hhalving insertion sorting

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0023] see Figure 1-2 , a computer internal sorting method for bidirectional alternate binary insertion sorting, comprising the following steps:

[0024] S1: Input random number sequence r[0...n-1];

[0025] S2: Initialize the sequence, if r[0]>r[n-1], exchange r[0] with r[n-1], the left end ordered sequence pointer left=0, the right end ordered sequence pointer right=n- 1;

[0026] S3: Scan from right to left, if r[right-1]>r[right], then r[right-1] is inserted to the rig...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the technical field of sorting methods, and discloses a computer internal sorting method for bidirectional alternate halving insertion sorting, which comprises the following steps: S1, inputting a random number sequence r [0... n-1]; s2, initializing a sequence, if r [0] >r [n-1], exchanging r [0] with r [n-1], and enabling a left end ordered sequence pointer left to be equal to 0 and a right end ordered sequence pointer right to be equal to n-1; s3, carrying out scanning from the right end to the left, and if [right-1]> r [right], inserting r [right-1] into the rightend, and carrying out right--; if r [right-1] <r [right], carrying out right--, comparing r [right] and r [left], if r [right]< r [left], inserting r [right] into the left end, and then enabling r [right] = r [left]. The method has the advantages that sorting is carried out in an original sequence, the left end and the right end of the sequence are sorted in a non-decreasing mode and then gradually get close to the middle, and meanwhile it is guaranteed that the data of the right-end ordered sequence is not smaller than the data of the left-end ordered sequence; when the data to be sorted is scanned, and inserting big data into the right ordered sequence and inserting small data into the left ordered sequence, so that the data movement frequency is effectively reduced.

Description

technical field [0001] The invention relates to the technical field of sorting methods, in particular to a computer internal sorting method for bidirectional alternate binary insertion sorting. Background technique [0002] Insertion sort is one of the simplest sorting algorithms in computer internal sorting. Its basic idea is to treat the first element as an initial ordered sequence, start from the second element, and insert all elements forward into the sequence one by one. Insertion sorting mainly has two basic operations, that is, data comparison when finding the insertion position and data movement when inserting. Usually, the number of data comparisons and the number of data movements are used as the time complexity of the algorithm. According to the different ways of finding the insertion position, it is divided into direct insertion sort and half insertion sort. Binary insertion sorting can also be regarded as an improved algorithm of direct insertion sorting. Thro...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F7/24
CPCG06F7/24
Inventor 袁琳琳王代星崔瑾
Owner GUIZHOU RADIO & TV UNIV