• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Prioritized LinkedList

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there
I'm new in java programming and I have implemented a prioritized LinkedList in java.

you can check it out here https://github.com/eng-mohammad/PriorityLinkedList and tell me what you think
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

In the Node class, how come your variable is named "oBject" instead of "object"?

Overall the class looks good. Two things you could do to make it more concise

1) No need for an if statement. These two code snippets do the same thing:





2) You can chain constructors to avoid duplicate code



could be

 
Mohammad Khaled
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Welcome to CodeRanch!

In the Node class, how come your variable is named "oBject" instead of "object"?

Overall the class looks good. Two things you could do to make it more concise

1) No need for an if statement. These two code snippets do the same thing:





2) You can chain constructors to avoid duplicate code



could be



thank you so much for your nice replay, I think I've learnt from your notes much
wish you a nice day
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic