I am brand new at C++ and I have a programming assignment I have to do. I have to create a directed graph and perform a breadth-first traversal. I have to use an adjacency linked list implementation without using any existing libraries as Standard Template Library. Where do I begin? Sorry, for the silly question, but I am not sure where to even begin. Thanks for any help whatsoever.
needhelp83
0
Newbie Poster
Recommended Answers
Jump to PostAre you sure you have the prequisits for that course? It sounds pretty advanced for a beginner.
Jump to PostThere's nothing to stop you from implementing your own "adjacency linked list implementation".
How about "adjacency linked list implementation"
Then make a directed graph based on that, and implement the traversal …
Jump to PostTell me, if the task was to implement it in Java, would you need the same amount of help?
Just do some research (I already gave you one link) and then try and implement it.
Yes, things like
- create list, add node, remove node
would seem like …
Jump to PostTo convert an ascii digit to numeris, all you have to do is subtract '0'. Here's one way to do it. Note that getchar() returns an int, not char.
int a = -1, b = -1; int input. while( (input = getchar()) != EOF) { if( isdigit(a) …
Jump to Postwhile (nodePtr->pointer != a) { nodePtr = nodePtr->next; }
What happens when thre are no nodes whose value is equal to variable a? Answer: infinite loop that will eventually crash your program. That loop needs to also check for end-of-linked-list, which is normally indicated by NULL nodePtr
…
All 17 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
needhelp83
0
Newbie Poster
Salem
5,138
Posting Sage
needhelp83
0
Newbie Poster
needhelp83
0
Newbie Poster
Salem
5,138
Posting Sage
needhelp83
0
Newbie Poster
needhelp83
0
Newbie Poster
needhelp83
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
needhelp83
0
Newbie Poster
needhelp83
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
needhelp83
0
Newbie Poster
needhelp83
0
Newbie Poster
Salem
5,138
Posting Sage
needhelp83
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.