Skip to content

O(n) makeheap #14

@make-github-pseudonymous-again

Description

// >= 0 is necessary when arity = 1 and n = 0
for ( k = ( n + arity - 2 ) / arity | 0 ; k-- >= 0 ; ) {
    siftdown( arity , compare , swap , a , 0 , n , k ) ;
}

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions