• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Implementing a linear circular linked list with singly linked sub-lists

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently working on this project for my Java data structures class and am kind of lost. I have scoured my textbook and several other books in the library but have not really found anything useful on the subject. I asked my instructor but haven't gotten much insight to be honest. So I come to you...

I need to have a record of students (which will be the circular linked list) and their courses (that will be the singly linked list. I need to be able to add/delete students, modify student info and display student data. In addition, I need to be able to add a course to a student course list, delete course from student course list, and modify course data for a specific student. I will have a student node, course node, manager (which contains all methods), and user (contains main, and is the "driver") classes.

All I have at the moment is my studentNode, and my courseNode. I am just totally stuck on how to proceed. I know my request is vague but any help or suggestions that would get me headed in the right direction from here would be greatly appreciated!

studentNode


courseNode

 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why you want to use circular linked list?
 
Tony Vega
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tushar Goel wrote:Why you want to use circular linked list?



A circular link list was required for the assignment.
 
Tony Vega
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have made some progress with my addStudent method


But now I need to figure how to add a course to the course list. The studentNode has the course list pointer "courseNode CLPointer" How would I use this to add a course node to the student node?
 
Tony Vega
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also had to change my constructor to receive student ID
 
Marshal
Posts: 79943
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are making things hard for yourself by writing code. I think you need to step back and consider your design. What does the list of courses mean? Where does it belong?
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic