We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>
+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion
How to Add New Discussion in Study Group ? Step By Step Guide Click Here.
CS301 Assignment No 01 Fall 2019 Solution & Discussion
Tags:
+ How to Follow the New Added Discussions at Your Mail Address?
+ How to Join Subject Study Groups & Get Helping Material? + How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators? + VU Students Reserves The Right to Delete Your Profile, If?.
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)Please Discuss here about this assignment.Thanks
Our main purpose here discussion not just Solution
Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.
P.S: Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”
Then copy Questions from assignment file and paste in Discussion.
+ http://bit.ly/vucodes (For Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (For Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?)
+ Click Here to Join (Our facebook study Group)
this file is not running.. generating errors
this file is not running.. generating errors
CS301 Data Structures Assignment 1 Solution Fall 2019
#include <stdlib.h>
#include <iostream>
struct StudentDetail{
string name;
string vuid;
};
//class Node* head;
class Node{
struct StudentDetail newStd;
class Node* next;
class Node* prev;
void Set(string name,string vuid)
{
newStd.name=name;
newStd.vuid=vuid;
}
Node Get()
{
}
void setNext(string name,string vuid){
if(next==NULL)
{
}
else
{
class Node* newNode= new Node();
newStd.name=name;
newStd.vuid=vuid;
newNode->next= newNode;
} }
string getNext()
{
next;
}
void setPrev(string name,string vuid){
if(next==NULL)
{
}
else
{
class Node* newNode= new Node();
newStd.name=name;
newStd.vuid=vuid;
newNode->next= newNode;
} }
string getPrev()
{
prev;
}
};
class DoublyLinkedList{
public:
struct StudentDetail newStd;
class DoublyLinkedList* headPtr;
class DoublyLinkedList* curPtr;
class DoublyLinkedList* nextPtr;
int size;
//dfdf
class DoublyLinkedList* headDlinkList=NULL;
void addAtBegining(string vuid, string name)
{
class DoublyLinkedList* dNode= new DoublyLinkedList();
dNode->newStd.vuid=vuid;
dNode->newStd.name=name;
dNode->nextPtr=headDlinkList;
headDlinkList= dNode;
dNode->curPtr=dNode;
}
void addAtEnd(string vuid, string name)
{
class DoublyLinkedList* dNode= new DoublyLinkedList();
dNode->newStd.vuid=vuid;
dNode->newStd.name=name;
dNode->nextPtr=headDlinkList;
headDlinkList= dNode;
dNode->curPtr=dNode;
}
void delNode()
{
class DoublyLinkedList* temp1=curPtr;
class DoublyLinkedList* temp2= temp1;
temp1->nextPtr= temp2->nextPtr;
free(temp2);
}
void print()
{
class DoublyLinkedList* temp= headDlinkList;
while(temp!=NULL)
{
couttemp->newStd.vuid" "temp->newStd.nameendl;
temp= temp->nextPtr;
}
}
};
int main()
{
string vuid,name;
cout"Add your vuID and Name at First Position "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
DoublyLinkedList dlist1;
cin>>vuid;
cin>>name;
dlist1.addAtBegining(vuid,name);
dlist1.print();
cout"Insertion At Beginning in doubly Link List "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
cin>>vuid;
cin>>name;
dlist1.addAtBegining(vuid,name);
dlist1.print();
cout"Insertion At End in doubly Link List "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
cin>>vuid;
cin>>name;
dlist1.addAtEnd(vuid,name);
dlist1.print();
cout"Deletion of Current Node (Last Node) "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
dlist1.delNode();
dlist1.print();
}
CS301 Data Structures Assignment 1 Solution Fall 2019
#include <stdlib.h>
#include <iostream>
struct StudentDetail{
string name;
string vuid;
};
//class Node* head;
class Node{
struct StudentDetail newStd;
class Node* next;
class Node* prev;
void Set(string name,string vuid)
{
newStd.name=name;
newStd.vuid=vuid;
}
Node Get()
{
}
void setNext(string name,string vuid){
if(next==NULL)
{
}
else
{
class Node* newNode= new Node();
newStd.name=name;
newStd.vuid=vuid;
newNode->next= newNode;
} }
string getNext()
{
next;
}
void setPrev(string name,string vuid){
if(next==NULL)
{
}
else
{
class Node* newNode= new Node();
newStd.name=name;
newStd.vuid=vuid;
newNode->next= newNode;
} }
string getPrev()
{
prev;
}
};
class DoublyLinkedList{
public:
struct StudentDetail newStd;
class DoublyLinkedList* headPtr;
class DoublyLinkedList* curPtr;
class DoublyLinkedList* nextPtr;
int size;
//dfdf
class DoublyLinkedList* headDlinkList=NULL;
void addAtBegining(string vuid, string name)
{
class DoublyLinkedList* dNode= new DoublyLinkedList();
dNode->newStd.vuid=vuid;
dNode->newStd.name=name;
dNode->nextPtr=headDlinkList;
headDlinkList= dNode;
dNode->curPtr=dNode;
}
void addAtEnd(string vuid, string name)
{
class DoublyLinkedList* dNode= new DoublyLinkedList();
dNode->newStd.vuid=vuid;
dNode->newStd.name=name;
dNode->nextPtr=headDlinkList;
headDlinkList= dNode;
dNode->curPtr=dNode;
}
void delNode()
{
class DoublyLinkedList* temp1=curPtr;
class DoublyLinkedList* temp2= temp1;
temp1->nextPtr= temp2->nextPtr;
free(temp2);
}
void print()
{
class DoublyLinkedList* temp= headDlinkList;
while(temp!=NULL)
{
couttemp->newStd.vuid" "temp->newStd.nameendl;
temp= temp->nextPtr;
}
}
};
int main()
{
string vuid,name;
cout"Add your vuID and Name at First Position "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
DoublyLinkedList dlist1;
cin>>vuid;
cin>>name;
dlist1.addAtBegining(vuid,name);
dlist1.print();
cout"Insertion At Beginning in doubly Link List "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
cin>>vuid;
cin>>name;
dlist1.addAtBegining(vuid,name);
dlist1.print();
cout"Insertion At End in doubly Link List "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
cin>>vuid;
cin>>name;
dlist1.addAtEnd(vuid,name);
dlist1.print();
cout"Deletion of Current Node (Last Node) "endl;
cout"_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ __ _ _"endl;
dlist1.delNode();
dlist1.print();
}
CS301-Assignment-1-Solution-Fall-2019_Correct
Below link
error aa raha
© 2019 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
VU Students reserves the right to delete profile, which does not show any Activity at site nor has not activity more than 01 month.
We are user-generated contents site. All product, videos, pictures & others contents on vustudents.ning.com don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com or Contact us at contact Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post