PPL Assignment
IRM2015006
KBest< T > Class Template Reference

#include <kbest.h>

Collaboration diagram for KBest< T >:
Collaboration graph

Public Member Functions

 KBest (std::vector< T > elements)
 
template<typename Comparator >
std::vector< TgetKBest (int k, Comparator &comparator)
 

Private Attributes

std::vector< Telems
 

Detailed Description

template<class T>
class KBest< T >

Implementation of KBEST class KBest class This class uses STL, to find K best elements of a given vector based on some comparator

Definition at line 13 of file kbest.h.

Constructor & Destructor Documentation

template<class T >
KBest< T >::KBest ( std::vector< T elements)
inline

Definition at line 20 of file kbest.h.

Member Function Documentation

template<class T >
template<typename Comparator >
std::vector<T> KBest< T >::getKBest ( int  k,
Comparator &  comparator 
)
inline

STL method to get K Best elements

Definition at line 26 of file kbest.h.

Member Data Documentation

template<class T >
std::vector<T> KBest< T >::elems
private

The elements under consideration

Definition at line 17 of file kbest.h.


The documentation for this class was generated from the following file: