Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Quick-sort in VB

Empfohlene Antworten

Hi, habe leider ein Problem:

habe folgende Code für ein Gui(momentan noch mit shakersort):

Hier soll passend das Quick-Sort-Verfahren rein. Evtl kann mir ja jemand helfen, denn damit bin ich echt überfragt :-(, denn in VB habe ich momentan noch überhaupt nichts gemacht.

Private Sub cmd_clear_Click()

lst_values.Clear

End Sub

Private Sub cmd_fill_Click()

Dim i As Integer

For i = 1 To 20

lst_values.AddItem (20 - i)

Next

End Sub

Private Sub cmd_quit_Click()

End

End Sub

Private Sub cmd_Sort_Click()

Call shakersort(lst_values, lst_values.ListCount)

End Sub

Private Sub shakersort(ListBox As ListBox, N As Integer)

Dim higher, lower, lastswap As Integer

Dim swap As Double

lower = 0

higher = N - 1

lastswap = N - 1

With ListBox

Do

'Bubble vom höchsten zum niedrigsten

For j = higher To lower Step -1

If CDbl(.List(j - 1)) > CDbl(.List(j)) Then

swap = CDbl(.List(j - 1))

.List(j - 1) = .List(j)

.List(j) = swap

lastswap = j

End If

.Refresh

Next

lower = lastswap + 1

'Bubble vom niedrigsten zum höchsten

For j = lower - 2 To higher - 1

If .List(j + 1) < .List(j) Then

swap = CDbl(.List(j + 1))

.List(j + 1) = .List(j)

.List(j) = CStr(swap)

lastswap = j

End If

.Refresh

Next

higher = lastswap

Loop Until higher < lower

End With

End Sub

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.