Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- using namespace std;
- int main()
- {
- Node * pHead = new Node(1);
- pHead->setpNext(new Node(3));
- printList(pHead);
- addListHead(0, pHead);
- //printList(pHead);
- Node* pCurrent = pHead->detpNext();
- addlist(2, pCurrent);
- printList(pHead);
- // addlist(5, pCurrent);
- //printList(pHead);
- cout << findInList(3, pHead) << endl;
- cout << findInList(8, pHead) << endl;
- addlist(4, findInList(3, pHead));
- printList(pHead);
- delListHead(pHead);
- printList(pHead);
- delListNode(findInList(2, pHead));
- printList(pHead);
- cout << "==============================================" << endl;
- /*Node k1;
- cout << "getData() = " << k1.getData() << endl;
- cout << "getpNext() = " << k1.detpNext() << endl;
- cout << "Enter data: ";
- DataType value;
- cin >> value;
- k1.setData(value);
- cout << "New getData() for K1 = " << k1.getData() << endl;*/
- Quene q;
- q.enque(1);
- q.enque(2);
- q.show();
- DataType value = 0;
- if (q.deque(value) == true)
- {
- cout << value << endl;
- }
- else
- {
- cout << "Quene is empty" << endl;
- }
- q.show();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement