Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //binarytree.cpp
- #include <iostream>
- #include "binarytree.h"
- using namespace std;
- int main(int argc, char* argv[])
- {
- PlayerBST tree;
- Player miyako("Miyako", "Mage", 250, 525, 13, 13000);
- Player sakura("Sakura", "Rogue", 300, 70, 10, 10500);
- Player kaori("Kaori", "Necromancer", 75, 132, 2, 1200);
- Player kyousuke("Kyousuke", "Knight", 500, 50, 12, 12755);
- Player tuomas("Tuomas", "Berserker", 890, 105, 25, 25999);
- Player jack("Jack", "Ranger", 430, 50, 20, 20943);
- Player ayame("Ayame", "Spellblade", 600, 275, 31, 31225);
- Player ayako("Ayako", "Healer", 500, 900, 29, 29175);
- tree.insert(miyako);
- tree.insert(sakura);
- tree.insert(kaori);
- tree.insert(kyousuke);
- tree.insert(tuomas);
- tree.insert(jack);
- tree.insert(ayame);
- tree.insert(ayako);
- cout << "Tree contents before sorting:\n";
- miyako.playerDisplay();
- sakura.playerDisplay();
- kaori.playerDisplay();
- kyousuke.playerDisplay();
- tuomas.playerDisplay();
- jack.playerDisplay();
- ayame.playerDisplay();
- ayako.playerDisplay();
- cout << "After sorting by level:\n";
- tree.inorder();
- cout << "Breadth first:\n";
- tree.breadthFirst();
- cout << "Searching for the level 25 player:\n";
- tree.search(25);
- //void deleteByMerging(BSTNode<T>*&);
- //void findAndDeleteByMerging(const T&);
- //tree.inorder();
- //cout << "Value of node = " << *tree.search(10);
- cin.get();
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement