okay i need some help with this...i'm creating a graph program..the problem is the linked has to be user specified...i manage to create a linked list..i don't know how to create another one...its some sort like this :
0 1 2
0 - - > created this
1 - - > don't know how to create this
2 - - > and this...
void displayMenu()
{
cout<<"1) Addition of vertices "<<endl;
cout<<"2) Deletion of vertices"<<endl;
cout<<"3) Addition of edges"<<endl;
cout<<"4) Deletion of edges"<<endl;
cout<<"5) Modification of vertex labels"<<endl;
cout<<"6) Saving a graph in a text file"<<endl;
cout<<"7) Loading a graph from a text file"<<endl;
cout<<"8) Displaying a graph by printing out the adjacency lists"<<endl;
}
int main()
{
int option;
List aList;
displayMenu();
cout<<endl;
cin>>option;
switch(option)
{
case 1 :aList.insert();
break;
case 2 :aList.remove();
break;
case 3 :aList.insert();
break;
case 4 :aList.remove();
break;
i need ideas to implement this graph...thank u in advance guys...appreciate ur help..i have a header file..
class List
{
public:
List();
bool isEmpty() const;
int getLength() const;
void insert(int index, const ListItemType& newItem, bool& success);
void remove(int index, bool& success)
void retrieve(int index, ListItemType& dataItem,
bool& success) const;
private:
ListItemType items[MAX_LIST];
int size;
int translate(int index) const;
}; // end List
thanks again guys...