void myClass :: print()
{
cout << endl;
temp = head;
if (head == NULL)
{
cout << endl;
cout << " Sorry! Link List is empty" << endl;
cout << endl;
Sleep(1000);
return;
}
while (temp != NULL)
{
cout << temp->data << endl;
temp= temp->next;
}
system("pause");
}
Thursday, 10 September 2015
Saturday, 5 September 2015
C++ Program to insert a new nod and Value in Doubly Link List
#include <iostream>
using namespace std;
struct nod
{
int data;
nod *next;
nod *prev;
};
class myClass
{
private:
nod *head;
nod *temp;
public:
myClass()
{
head = NULL;
temp = NULL;
}
void insert();
void print();
};
Subscribe to:
Posts (Atom)