Last active
September 6, 2017 10:19
-
-
Save mirsahib/f52a1cdd6859103dcca832f2f1d03471 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
*List.h | |
* | |
*Created on: Aug 19, 2017 | |
* Author: Mir Sahib | |
* | |
*/ | |
#ifndef LIST_H_ | |
#define LIST_H_ | |
class List{ | |
private: | |
typedef struct node{ | |
int data; | |
node* next; | |
}* nodePtr; | |
nodePtr head; | |
nodePtr curr; | |
nodePtr temp; | |
nodePtr prev; | |
public: | |
List(); | |
nodePtr getHead();// return head memory location | |
nodePtr getPrev(); | |
void setPrev(nodePtr newPrev); | |
void setHead(nodePtr newHead); | |
void addNode(int addData); | |
void deleteNthPosition(int pos); | |
void insertNodeToHead(int newData); | |
void insertToNthPosition(int pos,int newData); | |
void reverseList(); | |
int lengthOfTheList(); | |
//recursive function | |
void printRecurs(nodePtr temp); | |
void reverseRecurs(nodePtr temp); | |
void printNode(); | |
}; | |
#endif /* LIST_H_ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment