Jump to content

need help with this. Thanks in advance

- - - - -

  • Please log in to reply
1 reply to this topic

#1
lina

lina

    Learning Programmer

  • Members
  • PipPipPip
  • 34 posts
Write a class that maintains the top 10 scores for a game application, implementing add and remove methods , but using a singly linked list instead of an array. Run and output the result from the following set of previous scores: 101, 34, 52, 100, 34, 1, 23, 203, 34, 57, 29, 3, 15..

public class GameScores {
protected Node head;
protected long size = 10;
/** Default constructor that creates an empty list */
public GameScores() {
head = null;
size = 0;
}
}

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I'd start by defining the Node class.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users