Computer Science > STUDY GUIDE > dgraph.cpp CS 311 (All)

dgraph.cpp CS 311

Document Content and Description Below

//CS311 Yoshii dgraph.cpp // INSTRUCTION: // Complete all the functions you listed in dgraph.h // Comment the file completely using How to Comment file. // Use HW6-help.docx to finish the function... s. //------------------------------------------------------- //====================================================== // HW#: HW6 dgraph // Name: KANISHQ PATEL // File Type: Implementation file //======================================================== #include "dgraph.h" #include <iostream> #include <fstream> #include <string> using namespace std; dgraph::dgraph() { for(int i = 0; i<SIZE; i++){ Gtable[i].vertexName = ' '; // set vertexName Gtable[i].visit = 0;// visit numbers (0) } countUsed = 0; // set countUsed 0 } dgraph::~dgraph() // do we have to delete all nodes of slists in table?? // Question: If we do not do this, will the llist destructor be called automatically??? Try it. { //It will be called automatically } void dgraph::fillTable() // read from the specified file { string fname; //string name is fname cout << "Enter a file name: "; cin >> fname; ifstream fin (fname.c_str(), ios::in); //open file fname // the rest is in HW6-help char addx; while(fin>> Gtable[countUsed].vertexName){// IF I CAN READ THE NAME fin>> Gtable[countUsed].outDegree; // loading the data for(int i = 0; i< Gtable[countUsed].outDegree; i++){ fin>>addx; /////// ( Gtable[countUsed].adjacentOnes).addRear(addx); //slist function from HW3 ////// } countUsed++;//increamenting count } [Show More]

Last updated: 2 years ago

Preview 1 out of 3 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Reviews( 0 )

$5.00

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

46
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 17, 2021

Number of pages

3

Written in

Seller


seller-icon
Muchiri

Member since 4 years

209 Documents Sold

Reviews Received
19
5
1
1
6
Additional information

This document has been written for:

Uploaded

Apr 17, 2021

Downloads

 0

Views

 46

Document Keyword Tags

Recommended For You

Get more on STUDY GUIDE »

$5.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·