• Post Reply Bookmark Topic Watch Topic
  • New Topic

making the enqueue, dequeue, and peek methods in Java  RSS feed

 
John Diesal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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:

 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • 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.
 
Rajith Pemabandu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajith Pemabandu, welcome to the Ranch That is a good link.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!