php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301- Data Structures Assignment No.1 Solution Spring 2014
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#2
I am sending you a C++ program related to linked list along with your assignment file. In the given C++ program, I did not write some functions. Name of these functions are given below.

1) main()
2) List addNodes(int number)
3) void split(int c, List list, List largeList, List smallList)
4) void differenceList(List listA, List listB)
Linked List:
#include <iostream.h>
#include <stdlib.h>

class Node
{
public:
int get() { return object; };
void set(int object) { this->object = object; };
Node * getNext() { return nextNode; };
void setNext(Node * nextNode) { this->nextNode = nextNode; };
private:
int object;
Node * nextNode;
};


class List
{
public:
List();
void add (int addObject);
int get();
bool next();
friend void traverse(List list);
friend List addNodes(int number);
friend void split(int c, List list, List largeList, List smallList);
friend void differenceList(List listA, List listB);



private:
int size;
Node * headNode;
Node * currentNode;
Node * lastCurrentNode;
};
/* Constructor */
List::List()
{
headNode = new Node();
headNode->setNext(NULL);
currentNode = NULL;
lastCurrentNode = NULL;
size = 0;
}
/* add() class method */
void List::add (int addObject)
{
Node * newNode = new Node();
newNode->set(addObject);
if( currentNode != NULL )
{
newNode->setNext(currentNode->getNext());
currentNode->setNext( newNode );
lastCurrentNode = currentNode;
currentNode = newNode;
}
else
{
newNode->setNext(NULL);
headNode->setNext(newNode);
lastCurrentNode = headNode;
currentNode = newNode;
}
size ++;
}
/* get() class method */
int List::get()
{
if (currentNode != NULL)
return currentNode->get();
}
/* next() class method */
bool List::next()
{
if (currentNode == NULL) return false;
lastCurrentNode = currentNode;
currentNode = currentNode->getNext();
if (currentNode == NULL || size == 0)
return false;
else
return true;
}
/* Friend function to traverse linked list */
void traverse(List list)
{
Node* savedCurrentNode = list.currentNode;
list.currentNode = list.headNode;
cout "\n\n Elements of list are given below ";
for(int i = 1; list.next(); i++)
{
cout "\n Element " i " " list.get();
}
cout "\n List size = " list.size '\n';
list.currentNode = savedCurrentNode;
}

void split(int c, List list, List largeList, List smallList)
{

}



List addNodes(int number)
{

}

void differenceList(List listA, List listB){

}



main()
{


}


0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Messages In This Thread
CS301- Data Structures Assignment No.1 Solution Spring 2014 - by Vuhelper - 05-07-2014, 03:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  SEO in Simple Words: How a VU Student Can Write a Clearer Assignment or Blog Post admin 0 57 11-01-2026, 05:11 AM
Last Post: admin
  Cs403 Assignment 3 Helping material May 8,2010 viki 1 5,299 04-28-2020, 03:19 PM
Last Post: ClaireBeauc
  cs301 assignment no 3 Solution 20 January 2016 Vuhelper 0 11,148 01-20-2016, 03:32 PM
Last Post: Vuhelper
  CS201 Assignment vo 3 Solution 20th January 2016 Vuhelper 2 2,674 01-20-2016, 03:28 PM
Last Post: Vuhelper
  CS101 Assignment no 3 Solution 20th January 2016 Vuhelper 0 2,344 01-20-2016, 03:25 PM
Last Post: Vuhelper
  SOC101 INTRODUCTION TO SOCIOLOGY assignment no 3 Solution 20 January 2016 Vuhelper 0 1,933 01-20-2016, 03:19 PM
Last Post: Vuhelper
  CS402 Assignment No 4 Solution & Discussion Xpert 0 2,160 08-01-2015, 02:33 AM
Last Post: Xpert
  cs101 Assignment No. 1 Solution 21 may spring 2015 semester Xpert 0 2,965 05-21-2015, 12:41 AM
Last Post: Xpert
  Assignment solution eng 301 due date 20 may 2015 rumesa khan 3 4,604 05-20-2015, 01:34 AM
Last Post: Xpert
  PHY301 Circuit Theory Assignment No. 1 idea Solution spring may 2015 semester Xpert 0 1,620 05-15-2015, 03:52 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support