VUsolutions Transferred to AchiKhasi.com
From December 2011, this blog www.VUsolutions.blogspot.com is transferred to http://achikhasi.com/vu/ . So, you may visit http://achikhasi.com/vu/ for latest study related help.
Back to home VUsolutions
VUsolutions Fans Club [join us for MORE solutions]
VUsolutions on Facebook
Important & Cool Links
Islamic Books in Urdu ! Beauty Tips in Urdu ! Online VU Lectures ! Unique Wallpapers ! Cooking Recipes - Urdu ! Women Kahani Ghar ! Health Tips in Urdu ! Showbiz Hidden Stories ! News Updates Online ! Bachon Ki Duniya ! Virtual University Study ! Prep to PhD Study Help ! Girls Women Block ! AIOU Study Block ! News & Politics Block ! Mix Plate Block - Others
-- Header File Source
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include
using name space std;
template span>class T>
class LList
{
Private:
class ListNode
{
friend class LList;
T value;
ListNode *nest;
ListNode(T value1, ListNode *next1=NULL)
{
value=value1;
next=next;
}
};
ListNode *head;
public:
LList()
{
head=NULL;
)
~LList();
void appendNode(T);
void insertNode(T);
void deleteNode();
voide displayList();
void MoveNext();
void ShowCurrent();
};
template
voidLList::appendNode(T val)
{
if(head=NULL)
head=new ListNode(val);
else
{
ListNode *nodePtr;
while (nodePtr->next !=NULL)
nodePtr->next=new ListNode(val);
}
}
template
voidLList::displayList()
{
ListNode *nodePtr;
nodePtr =head;
while (nodePtr)
{
cout nodePtr->value endl;
nodePtr =nodePtr->next;
}
}
template
voidLList::ShowCurrent()
{
ListNode *nodePtr;
nodePtr=head;
countnodePtr->value endl;
}
template
voidLList::MoveNext()
{
ListNode *nodePtr;
nodePtr=head;
while (nodePtr)
{
nodePtr = nodePtr->next;
}
}
template
voidLList::insertNode(T val)
{
ListNode *nodePtr, *previousNodePtr;
if(head==NULL || head->value>=val)
{
head=new ListNode(val, head);
}
else
{
previousNodePtr=head;
nodePtr = head->next;
while (nodePtr !=Null&&nodePtr->value
{
previousNodePtr=NodePtr;
nodePtr = nodePtr->next;
previousNodePtr->nest=new ListNode(val, nodePtr);
template
voidLList::deleteNode()
{
ListNode *nodePtr, *previousNodePtr;
if(!head)
return
nodePtr=head;
head=head->next;
deletenodePtr;
}
template
LList::~LList
()
{
ListNode *nodePtr, *nextNodePtr;
nodePtr=head;
while (nodePtr !=NULL)
{
nextNodePte=nodePtr->nest;
delete nodePtr;
nodePtr=nextNodePtr;
}
}
#endif
Source of Mail Program
#include
#include
#include
#include "LList.h"
int main()
{
int TotalPersons=0,NumberofPasses,
LoopCounter=0,a=0,b=0;
string NameToAppend
count"how many people will play parates of Carribeans : course of black pearl game?
";
cin>>TotalPersons;
count"how many passes will be displayed? ";
cin>>NumberofPasses;
LListlist;
while(LoopCounter <=TotalPersons)
{
count"enter players name: ";
cin>>NameToAppend
list.appendNode(nameToAppend);
LoopCounter +=1;
}
while(a<=TotalPersons-1)
{
for(int c=0;c<=NumberodPasses;c++)
{
list.MoveNext();
}
count"removing :";
list.deleteNode();
list.ShowCurrent();
a+=1;
}
count"\nthe survivor is";
list.displayList();
getch();
Back to home VUsolutions
Shaadi.com: Just create ur account & find ur partner or EARN money, its reall & EASY
VUsolutions Followers (Join NOW and Get Extra Benefits)
VU related Blogs
Install LATEST toolbar having lot of features - GET solutions on Desktop
toolbar powered by Conduit |