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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


