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計數排序。 謝謝
計數排序只需要一個屬性進行排序,在你的類中,所有的屬性都是公共的,因此你可以對它進行排序。那麼是什麼問題,詳細解釋,你需要代碼還是其他的東西 –