Does anyone know how to create circular linked list whose links are numbered from 1 to n specified by the user?
cblue
0
Newbie Poster
Recommended Answers
Jump to PostDoes anyone know how to create circular linked list whose links are numbered from 1 to n specified by the user?
Yes.... yes, I do.
I love answering questions sometimes!
Create a circular linked list class and add an index member variable that will always be +1 …
Jump to Posthow do i do it, not quite clear on it, any help would greatly be appreciated.
Here is a code snippet of a function to initialize something using a value:
…void FillMyArray(int ArrayToBeFilled[], int TopValueToBeInserted) { for(int i = 1; i<=TopValueToBeInserted;i++) { ArrayToBeFilled[i] = i; } }
Jump to Postvoid FillMyArray(int ArrayToBeFilled[], int TopValueToBeInserted) { for(int i = 1; i<=TopValueToBeInserted;i++) { ArrayToBeFilled[i] = i; } }
The usual (and correct) idiom is like this.
for(int i = 0; i < TopValueToBeInserted; i++)
An array of size N is indexed from 0 to N-1.
All 10 Replies
marinme
0
Junior Poster in Training
cblue
0
Newbie Poster
marinme
0
Junior Poster in Training
Dave Sinkula
2,398
long time no c
Team Colleague
marinme
0
Junior Poster in Training
Dave Sinkula
2,398
long time no c
Team Colleague
marinme
0
Junior Poster in Training
cblue
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
jai verma
-4
Newbie Poster
Salem
commented:
You should have saved yourself the hassle of joining, if that's the best you can do
-4
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.