Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- class Node{
- public:
- int data;
- Node* next;
- };
- class LinkedList{
- Node* head;
- public:
- LinkedList(){
- head = NULL;
- }
- void Insert(int data){
- Node* NewNode = new Node();
- NewNode -> data = data;
- NewNode -> next = NULL;
- head = NewNode;
- }
- void Delete(){
- Node* Temp = head;
- head = Temp -> next;
- delete(Temp);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement