Pointers and Linked lists

I have a program and can't seem to figure out any decent way to approach the solution for it. It requires that I must use pointers and linked lists to solve the problem.  The program is as follows:  

Write a program that reads a positive integer n input at a terminal and does the following:
1.  Prints the table of Farey fractions up to order n
2.  Prints the reversed table, i.e last row first.

For example, if n = 3, then the output looks somewhat like this:
1        0/1, 1/1

2        0/1, 1/2, 1/1

3        0/1, 1/3, 1/2, 2/3, 1/1
---------------------------------
3        0/1, 1/3, 1/2, 2/3, 1/1

2        0/1, 1/2, 1/1

1        0/1, 1/1


Please help if you know exactly how to solve this programming problem.  Many thanks in advance

Ideal
IdealzxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nietodCommented:
We cannot provide answers to school assignments.  That is grounds for removal from this site.  (for both you and the experts involved.)  We can provide only limitied help in accademic assignments.    We can answer specific (direct) questions, like you might ask your teacher.  We can review your work and post suggestions, again, like your teacher might do.

Do you have specific questions?
Do you have any work on this (incomplete even) that we can review?
0
graham_kCommented:
Couldn't have phrased it better myself (and I've tried often enough).  Request permission to cut for future pasting to other language forums which you might not patrol ?
0
nietodCommented:
Other have already done so!
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

graham_kCommented:
then who am I to think that I am somehow bnetter than others?
0
nietodCommented:
Well its nice to be asked anyways.
0
ArvindtnCommented:
I don't have enough time to give you the code may be i could give you the logic.

Have a Double Link List which would contain the numbers 1 ... n, For each value of N, have another single link list which contain the value for that particular node value ( Value of N ).

Prototype would be

Struct Data
{
    int Number;
    //would contain the number 1...N
}

Struct Fraction
{
    float Fract;
// would contain the value of 0/1, etc
}

Struct Vertical
{
    Fraction FractValue;
    Vertical *NextNode;
}

Struct Horizontal
{
   Horizontal *PreviousNode;
   Data Num;
   Horizontal *NextNode;
   Vertical *StartNode;
}

if you have any problem in understanding feel free to message me
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nietodCommented:
Arvindtn, you did read the question history, right?  Personally, I don't think what you posted was to much, but you need to be careful.  Provide help, not the answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.