Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class LinkedList
- {
- static struct node
- {
- int x;
- node* next;
- node* prev;
- };
- node* start;
- node* end;
- int size;
- node* _sort(node* r, int n);
- static void _swap(node* a, node* b){
- int t = a->x;
- a->x = b->x;
- b->x = t;
- }
- public:
- LinkedList();
- ~LinkedList();
- friend ostream& operator<<(ostream& out, const LinkedList& l);
- int push(int x);
- int pop();
- int unshift(int x);
- int shift();
- int find(int x);
- LinkedList* copy(int s, int e);
- LinkedList* splice(int s, int e);
- void sort(){
- start = _sort(start, size);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment