This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| CS 352, Summer '12 | |
| Victoria Wu | |
| Polynomial ADT | |
| poly.cpp | |
| ----------------------------------------- | |
| The polynomial is represented by a linked list of pairs, each containing | |
| the coefficient and exponents of each term. | |
| s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| CS 352, Summer '12 | |
| Victoria Wu | |
| Polynomial ADT | |
| ----------------------------------------- | |
| The polynomial is represented by a linked list of terms, each containing | |
| the coefficient and exponents of each term. | |
| -Add, Multiply, Equality functions for polynomials |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| CS 352, Summer '12 | |
| Victoria Wu | |
| Polynomial ADT Tester | |
| ----------------------------------------- | |
| */ | |
| #include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fstream simp; | |
| simp.open("simplify_test.txt"); | |
| Poly* pol1 = new Poly(); | |
| for(int i =0; i< 3; i++) | |
| { | |
| term t1(5, 1, 1); | |
| pol1->addTerm(t1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Poly* pol1 = new Poly(); | |
| for(int i =0; i< 3; i++) | |
| { | |
| term t1(5, 1, i); | |
| pol1->addTerm(t1); | |
| term t2(5, 1, i); | |
| pol1->addTerm(t1); | |
| pol1->addTerm(t2); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Making a Testing Tree, with many physical, one logical obj. | |
| //------------------------------------------------ | |
| Treap<Student>* oneLogical = new Treap<Student>(); | |
| oneLogical->insert(smallest); | |
| for(int x = 0; x< 2; x++) | |
| { | |
| oneLogical->insert(allStudents[x]); | |
| oneLogical->remove(allStudents[x]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for(int i =10000; i<= 160000; i*=2) | |
| { | |
| Treap<int>* time = new Treap<int>(); | |
| begin = clock(); | |
| for(int x = 0; x < i; x++) | |
| { | |
| time->insert(x); | |
| } | |
| end = clock(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for(int i =10000; i<= 160000; i*=2) | |
| { | |
| Treap<Student>* time = new Treap<Student>(); | |
| Student hello; | |
| for(int x = 0; x < i; x++) | |
| { | |
| hello = Student(x); | |
| time->insert(hello); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cout << "Finding Min Stuff " << endl << endl; | |
| for(int i =100000; i<= 1600000; i*=2) | |
| { | |
| Treap<Student>* time = new Treap<Student>(); | |
| Student hello; | |
| for(int x = 0; x < i; x++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for(int i =10000; i<= 160000; i*=2) | |
| { | |
| Treap<Student>* time = new Treap<Student>(); | |
| Student hello; | |
| for(int x = 0; x < i; x++) | |
| { | |
| hello = Student(x); | |
| time->insert(hello); |