Skip to main content

Posts

Showing posts with the label #Function_Library

Linked List Template

//This is just my own template for linked list (Stack and queus are just limitations which i dont want) //JUST A TEMPLATE CONTAINING MANY FUNCTIONS //Programmer - Aditya Gupta (now posting as TECHY3) #include<iostream> struct Node{   //single data nodes int dat; Node* next; }; //CAUTION-> DONT DECLARE 'TEMPORARY NODE' HERE, SINCE SOMEWHERE IN SOME LOOP IT MAY BE DELETED, AS WE DO IN POP class List{ Node *top,*rear; public: void Push(int dat); //pushes to end (last/rear) void Push(int dat, int loc); /*receives location also, for eg. if location passed as 5,                              then first use noofelements() to check whether it has at least 4 elements, then continues... to put given data at location 5, ie. initial 5th data becomes 6th*/ void tPush(int dat); //to push at top position *doesnt call push(in...