prg_vector_sort()

Abstract

Sorts the elements of a vector using a quicksort algorithm and a user-supplied comparison procedure.

Syntax

prg_vector_sort (vector_ptr, compare_proc)
Argument Type Description
vector_ptr PrgT_Vector * vector to be sorted
compare_proc PrgT_Vector_Compare_Proc procedure used to compare elements during the sort

Return Type

void

No return value.

prg_vector.h

Details

This function sorts the elements of a vector using an implementation of the quicksort algorithm.

The vector sort can be orders of magnitude faster than a list sort done with prg_list_sort(). To take advantage of this speed, you can transfer a list to a vector (PrgT_Vector) and use prg_vector_sort(). The compare_proc can be the same one used for the list sort.

The prototype for compare_proc is given in PrgT_Vector_Compare_Proc.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com