Computer Classes

Computer Classes

Share

11/12/2018

Hello Friends,

Those have 4+ year of exp in angular,follow following link.

Thanks,

20/05/2017

Linked List using CPP (Object oriented concepts):


using namespace std;

class Node
{
int data;
Node *next;

public:

Node(int inData)
{
data = inData;
next = NULL;
}
Node * getNext()
{
return next;
}
void setNext(Node *inNode)
{
next = inNode;
}
int getData()
{
return data;
}
};
class LinkedList
{
Node *start;

public:

LinkedList()
{
start = NULL;
}

void insert(int inData)
{
Node *newNode = new Node(inData);
if ( start == NULL )
{
start = newNode;
}
else
{
Node *temp = start;
while (temp->getNext())
{
temp = temp -> getNext();
}
temp->setNext(newNode);
}
}

void display()
{
Node *temp = start;
while (temp )
{
int d = temp->getData();
printf("%d -> ",temp->getData());
cout getNext();
}
}
};
int main(int argc, const char * argv[])
{
LinkedList *ll= new LinkedList();
ll->insert(10);
ll->insert(20);
ll->insert(30);
ll->insert(40);
ll->display();

return 0;
}

Want your school to be the top-listed School/college in Pune?
Click here to claim your Sponsored Listing.

Category

Telephone

Address


Akurdi Railway Station
Pune
411035