rwlogo

Rogue Wave Views
Graph Layout Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator
List of all members | Public Member Functions | Protected Member Functions
IlvQuickSort Class Referenceabstract

A generic quick sort algorithm. More...

#include <ilviews/layout/util/quicksort.h>

Inherited by IlvIncidentLinksSorter.

Public Member Functions

 IlvQuickSort (IlInt size=0)
 
void sort (IlInt=-1)
 

Protected Member Functions

virtual IlBoolean compare (IlUInt loc1, IlUInt loc2)=0
 
virtual void swap (IlUInt, IlUInt)=0
 

Detailed Description

A generic quick sort algorithm.

Library: ilvlayout

Constructor & Destructor Documentation

IlvQuickSort::IlvQuickSort ( IlInt  size = 0)

Creates a new instance of the quicksort.

Parameters
sizeThe number of elements to be sorted.

Member Function Documentation

virtual IlBoolean IlvQuickSort::compare ( IlUInt  loc1,
IlUInt  loc2 
)
protectedpure virtual

Compares two elements. For ascendant sort, must return IlTrue if element(loc1) <= element(loc2), IlFalse otherwise. For descendent sort, must return IlTrue if element(loc1) >= element(loc2), IlFalse otherwise.

void IlvQuickSort::sort ( IlInt  = -1)

Performs the quicksort.

virtual void IlvQuickSort::swap ( IlUInt  ,
IlUInt   
)
protectedpure virtual

Swaps two elements.


© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.