The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
12 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 Boss (41.3k points) | 12 views

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
49,845 questions
54,785 answers
189,431 comments
80,454 users