Jump to content

File:Comb sort demo.gif

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Comb_sort_demo.gif (269 × 257 pixels, file size: 788 KB, MIME type: image/gif, looped, 291 frames, 23 s)

Summary

Description
English: comb sort demo
中文(臺灣):梳排序的動畫展示,粉紅色長條代表這兩個元素被比較且不需交換,淺紅色長條代表這兩個元素被比較且需要交換,交換會在下一幀完成,33個元素,初始間距為33,遞減率1.24733,間距除遞減率後無條件捨去小數。

程式原始碼(vb)

   Dim gap, swaps, i, t, value(33) As Integer
   Dim ch As Double
   ch = 1.24733
   gap = 33
   swaps = 1
   Do While ((gap > 1) Or (swaps = 1))
       If gap > 1 Then gap = Int(gap / ch)
       i = 0
       swaps = 0
       Do While (i + gap < n)
           If value(i) > value(i + gap) Then
               t = value(i)
               value(i) = value(i + gap)
               value(i + gap) = t
               swaps = 1
           End If
           i = i + 1
       Loop
   Loop
此程式碼是根據中文維基梳排序完成。
Date
Source Own work
Author Jerejesse

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

23 August 2011

image/gif

b4f234f2ace871f3fa310e78b0879c44ce5d6d2a

807,115 byte

23.32000000000005 second

257 pixel

269 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:22, 3 November 2012Thumbnail for version as of 11:22, 3 November 2012269 × 257 (788 KB)Jerejesse加速動畫,僅比較的畫格(淡色)停留7/100秒,比較加交換的畫格(深色)停留12/100秒
12:31, 23 August 2011Thumbnail for version as of 12:31, 23 August 2011269 × 257 (788 KB)Jerejesse

The following page uses this file:

Global file usage

The following other wikis use this file: