Created
October 23, 2020 15:42
-
-
Save GiangHoGoVap/40ed38837e7fd10ff3764724b6e80d22 to your computer and use it in GitHub Desktop.
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
| int main() | |
| { | |
| FragmentLinkedList<int> test(10); | |
| for (int i = 0; i < 20; i++) | |
| { | |
| test.add(i, i * i + 10); | |
| } | |
| cout << test.toString() << endl; | |
| //FragmentLinkedList<int>::Iterator it = test.begin(); | |
| auto it = test.begin(); | |
| auto it2 = test.begin(1); | |
| for (; it != it2; it++) | |
| { | |
| cout << *it << " "; | |
| it.remove(); | |
| } | |
| cout << test.toString() << endl; | |
| it = test.begin(); | |
| for (; it != it2; it2++) | |
| { | |
| test.add(0, *it2); | |
| it2.remove(); | |
| } | |
| cout << test.toString() << endl; | |
| return 0; | |
| } |
GiangHoGoVap
commented
Oct 27, 2020
Author

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment