• 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

making the enqueue, dequeue, and peek methods in Java

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to Java, and this is for school. I'm confused how to approach the methods, and how to build them? Is there an algorithm to build the methods, or a certain type of thinking needed in order to approach the problem?




This is the class that this code uses:

 
Rancher
Posts: 5035
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The methods have some comments describing what they are supposed to do.
Choose one of the methods to work on and ask some questions about what problems you are having designing the code to implement it.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose you refer this http://eddmann.com/posts/implementing-a-queue-in-java-using-arrays-and-linked-lists/  and try to implement the remaining methods.

 
John Diesal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rajith Pemabandu

Can you provide another link? The link you sent me doesn't exist.
 
Rajith Pemabandu
Greenhorn
Posts: 23
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My bad.

http://eddmann.com/posts/implementing-a-queue-in-java-using-arrays-and-linked-lists/
 
Marshal
Posts: 79953
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rajith Pemabandu, welcome to the Ranch That is a good link.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny 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