The Gateway to Computer Science Excellence
0 votes
88 views
PARTITION(A,p,r)

1    x = A[r]
2    i = p – 1
3    for j = p to r – 1
4    if A[j] <= x
5    i = i + 1
6    exchange A[i] with A[j]
7    exchange A[i+1] with A[r]
8    return i + 1

 

illustrate the operation of PARTITION on the array $A=\langle 13,19,9,5,12,8,7,4,21,2,6,11\rangle$

in Algorithms by | 88 views
0
Answer this question

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,345 questions
60,484 answers
201,813 comments
95,289 users