HOME Linked list: In order to store elements in the sequential fashion we use Arrays. But they are fixed max size,suppose if we want to use less memory than that of fixed size then memory is wastaged, or If we want to use more memory than that of fixed size then deficiency of the memory [...]
Archive for the ‘LINKEDLIST’ Category
LINKED LIST
April 1, 2008POLYNOMIAL
March 27, 2008HOME /*PROGRAM FOR ADDING,SUBTRACTION, MULTIPLYCATION OF 2 POLINOMIALS*/ #include<iostream.h> #include<stdlib.h> int d,i,y; static int z=0;//GLOBAL VARIABLES class poly//CLASS DECLARATION { private: float coeff; int degree; poly *next; public: void getdata(float ,int ); void add(); void show(poly *); void list_add(float ,poly *); void sub(); void list_sub(float [...]
DELETION_AT_ANYWHERE
March 27, 2008HOME /*PROGRAM FOR DELETION OF ELEMENTS AT ANYWHERE*/ #include”iostream.h” class List//NAME OF THE CLASS { private: //DATA MEMBERS int data; List *next; public: void insert_end(int); int del_any(); //MEMBER FUNCTIONS void display(); } *head; //OBJECT ACTS AS NODE //FUNCTION DECLARATION void List::insert_end(int ele) { List *n,*temp; n=new(List);//MEMORY ALLOCATION [...]
INSERTION_AT_ANYWHERE
March 27, 2008HOME /*PROGRAM FOR THE INSERTION OF THE ELEMENTS INTO THE LINKEDLIST AT ANYWHERE USING SELF REFERENTIAL CLASSES*/ #include<iostream.h> #include<stdlib.h> class List //NAME OF THE CLASS { private: //DATA MEMBERS int data; List *next; public: void insert_front(int); void insert_anywhere(int,int); void insert_end(int);//MEMBER FUNCTIONS [...]
INSERTION_AT_REARTEND
March 27, 2008HOME /* PROGRAM FOR THE INSERTION OF THE ELEMENTS INTO THE LINKEDLIST AT THE END USING SELF REFERENTIAL CLASSES */ #include”iostream.h” class List //NAME OF THE CLASS { private: //DATA MEMBERS int data; List *next; public: //MEMBER FUNCTIONS void insert_end(int); void display(); } *head; //OBJECT ACTS AS [...]
INSERTION_AT_FRONTEND
March 27, 2008HOME /*PROGRAM FOR THE INSERTION OF THE ELEMENTS INTO THE LINKEDLIST AT THE FRONTEND USING SELF REFERENTIAL CLASSES */ #include”iostream.h” class List //NAME OF THE CLASS { private: //DATA MEMBERS int data; List *next; public: void insert_front(int); //MEMBER FUNCTIONS void display(); } *head; //OBJECT ACTS AS NODE void List::insert_front(int [...]