Skip to content

Instantly share code, notes, and snippets.

@GiangHoGoVap
Created October 23, 2020 15:42
Show Gist options
  • Select an option

  • Save GiangHoGoVap/40ed38837e7fd10ff3764724b6e80d22 to your computer and use it in GitHub Desktop.

Select an option

Save GiangHoGoVap/40ed38837e7fd10ff3764724b6e80d22 to your computer and use it in GitHub Desktop.
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

Copy link
Copy Markdown
Author

Screenshot (669)

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