Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. //
  2. // main.cpp
  3. // 01_singly_linked_list
  4. //
  5. // Created by 박대호 on 2016. 10. 27..
  6. // Copyright © 2016년 박대호. All rights reserved.
  7. //
  8.  
  9. #include "SinglyLinkedList.hpp"
  10. #include <iostream>
  11. using namespace std ;
  12.  
  13. int main(int argc, const char * argv[]) {
  14. // insert code here...
  15.  
  16. SLL *sll = new SLL();
  17. sll->print();
  18.  
  19. for(int i=0 ; i<5 ; i++)
  20. sll->push_front(i);
  21. sll->print();
  22.  
  23. sll->remove(6);
  24. sll->remove(1);
  25. sll->remove(2);
  26. sll->print();
  27.  
  28. for(int i=0 ; i<3 ; i++)
  29. sll->pop_front();
  30. sll->print();
  31.  
  32. delete sll ;
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement