void Essai1() { cout << "----- 1. Test du template ListeTriee avec des entiers ------------------------" << endl; cout << "Creation d'une Liste triee..." << endl; SortedList<int> liste; liste.display(); // --> () cout << endl; cout << "On insere 3,-2,5,-1,0 et -8..." << endl; liste.add(3); liste.add(-2); liste.add(5); liste.add(-1); liste.add(0); liste.add(-8); liste.display(); // --> (-8 -2 -1 0 3 5) cout << "La liste contient " << liste.size() << " elements." << endl; cout << endl; }
void Essai2() { cout << "----- 2. Test du template ListeTriee avec des Personnes ------------------------" << endl; cout << "Creation d'une Liste triee..." << endl; SortedList<Person> liste; liste.display(); cout << endl; cout << "On insere quelques personnes..." << endl; liste.add(Person("Starzak","Richard")); liste.add(Person("Vilvens","Claude")); liste.add(Person("Mercenier","Denys")); liste.add(Person("Wagner","Jean-Marc")); liste.add(Person("Starzak","Luc")); liste.add(Person("Charlet","Christophe")); liste.add(Person("Moitroux","Cecile")); liste.display(); cout << "La liste contient " << liste.size() << " elements." << endl; cout << endl; }
int main( int argc, char** argv ) { cout << "\n Double link list\n"; DoubleLink<int> dblVec; dblVec.push( 3 ); dblVec.push( 1 ); dblVec.push( 10 ); dblVec.push( 15 ); dblVec.push( 8 ); dblVec.display(); dblVec.pop(); dblVec.display(); cout << "\n Stack list\n"; Stack<int> stack; stack.push( 3 ); stack.push( 1 ); stack.push( 10 ); stack.push( 15 ); stack.push( 8 ); stack.display(); stack.pop(); stack.display(); // cout << stack.find( 10 ) << endl; cout << "\n Queue list\n"; Queue<int> queue; queue.push( 3 ); queue.push( 1 ); queue.push( 10 ); queue.push( 15 ); queue.push( 8 ); queue.display(); queue.pop(); queue.display(); // cout << queue.find( 10 ) << endl; cout << "\n Circle list\n"; CircleLink<int> circle; circle.push( 3 ); circle.push( 1 ); circle.push( 10 ); circle.push( 15 ); circle.push( 8 ); circle.display(); circle.pop(); circle.display(); // cout << circle.find( 10 ) << endl; cout << "\n Sorted list\n"; SortedList<int> sort; sort.push( 3 ); sort.push( 1 ); sort.push( 10 ); sort.push( 15 ); sort.push( 8 ); sort.display(); sort.pop(); sort.display(); // cout << sort.find( 10 ) << endl; cout << "\nPriority list\n"; PriorityList<int> plist; plist.push( 3 ); plist.push( 1 ); plist.push( 10 ); plist.push( 15 ); plist.push( 8 ); plist.display(); plist.pop(); plist.display(); cout << plist.find( 10 ) << endl; plist.display(); }