Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Latest commit

 

History

History
65 lines (52 loc) · 957 Bytes

File metadata and controls

65 lines (52 loc) · 957 Bytes

Voorbeeld Examen: Vragen/Oplossingen

Oefening 1.C.

BEGIN
    ALS k = 0 DAN
        RETOUR (a)
    ANDERS
        positie <- k
        max <- a[k]
        
        VOOR j = k - 1 TOT 0 STAP - 1 DOE
            ALS a[j] > max) DAN
                positie <- j
                max <- a[j]
            EINDE ALS
        EINDE VOOR
        a[positie] <- a[i]
        a[i] <- max
    EINDE ALS
    
    RETOUR selectionSortHulp(a, k - 1)
EINDE

Oefening 2

Push

 5
 10    5
 5     5
 7     7   
___   ___
 s     m

Pop

 5     5
 7     7   
___   ___
 s     m

Oefening 3

BEGIN
    links <- eerste.volgende
    rechts <- laatste.vorige
    
    ZOLANG links ≠ rechts EN links ≠ rechts.volgende DOE
        tmp <- links.data
        links.data <- rechts.data
        rechts.data <- tmp
        
        links <- links.volgende
        rechts <- rechts.vorige
    EINDE ZOLANG
EINDE