0
你好,我知道如何couting排序工作,如何实现它,但是有可能实现它在一个有3个属性,需要计数排除整个DisjointSet在一个特定属性的类。计数排序为一组
如果是这样,可以说我有这个类:
class myStructure {
public:
int m_id = -1;
myStructure* m_parent = NULL;
int m_sortie = -1;
int m_echeance = -1;
myStructure() {}
myStructure(int id, myStructure* parent, int sortie, int echeance)
: m_id(id), m_parent(parent), m_sortie(sortie), m_echeance(echeance)
{ }
};
我怎样才能实现对m_echance计数排序。 谢谢
计数排序只需要一个属性进行排序,在你的类中,所有的属性都是公共的,因此你可以对它进行排序。那么是什么问题,详细解释,你需要代码还是其他的东西 –