Advertisement
Timtsa

stdafx.cpp

Dec 11th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1.  
  2. #include "stdafx.h"
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9.     Node * pHead = new Node(1);
  10.     pHead->setpNext(new Node(3));
  11.     printList(pHead);
  12.  
  13.     addListHead(0, pHead);
  14.     //printList(pHead);
  15.     Node* pCurrent = pHead->detpNext();
  16.     addlist(2, pCurrent);
  17.     printList(pHead);
  18.     //  addlist(5, pCurrent);
  19.     //printList(pHead);
  20.     cout << findInList(3, pHead) << endl;
  21.     cout << findInList(8, pHead) << endl;
  22.     addlist(4, findInList(3, pHead));
  23.     printList(pHead);
  24.     delListHead(pHead);
  25.     printList(pHead);
  26.     delListNode(findInList(2, pHead));
  27.     printList(pHead);
  28.     cout << "==============================================" << endl;
  29.     /*Node k1;
  30.     cout << "getData() = " << k1.getData() << endl;
  31.     cout << "getpNext() = " << k1.detpNext() << endl;
  32.     cout << "Enter data: ";
  33.     DataType value;
  34.     cin >> value;
  35.     k1.setData(value);
  36.     cout << "New getData() for K1 = " << k1.getData() << endl;*/
  37.     Quene q;
  38.     q.enque(1);
  39.     q.enque(2);
  40.     q.show();
  41.     DataType value = 0;
  42.     if (q.deque(value) == true)
  43.     {
  44.         cout << value << endl;
  45.     }
  46.     else
  47.     {
  48.         cout << "Quene is empty" << endl;
  49.     }
  50.     q.show();
  51.     system("pause");
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement