This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Help Change Class Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help Change Class Please" Watch "Help Change Class Please" New topic
Author

Help Change Class Please

James P D Moore
Greenhorn

Joined: Mar 08, 2005
Posts: 5
Hello Members,
I would like to find out if anyone is nice enough to help me remove the ArrayList class from this code completely and replace it with something else that is not either of the following:

HashSet, LinkedHashSet, TreeSet, ArrayList, LinkedList, HashMap, TreeMap, LinkedHashMap, WeakHashMap, IdentityHashMap, Arrays, Collections, Hashtable, Vector

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Sure, there are plenty of people here that are willing to help you. However, most of the regulars here are not willing to do it for you. With that said, it looks like your list pretty much rules out the whole built-in Collections Framework. So why can't you use the standard Collections? And what ARE you allowed to use? If this is for a class, then I suspect you are supposed to write your own basic implementation of some data structure. We will be able to help you more if you give us some details about what you are trying to do and what restrictions are given on the homework assignment.

Regards,

Layne


Java API Documentation
The Java Tutorial
James P D Moore
Greenhorn

Joined: Mar 08, 2005
Posts: 5

Restrictions

You are expected to implement the data structures from scratch. Specifically you are not allowed to use the following classes from the java.util package :

HashSet, LinkedHashSet, TreeSet, ArrayList, LinkedList, HashMap, TreeMap, LinkedHashMap, WeakHashMap, IdentityHashMap, Arrays, Collections, Hashtable, Vector

You are allowed to implement any of the interfaces found within the Java Collections Framework such as Iterator, Enumeration,Comparable,List, Map etc


This code was not given to us but done by a friend of mine. I am basically useless at Java and cannot write it, but can roughly understand it!
Sayed Ibrahim Hashimi
Ranch Hand

Joined: May 17, 2001
Posts: 148
You should learn about simple data structures like a linked list. I'm guessing that's the aim of the course so most likely no one is going to implement it for you.


SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
James P D Moore
Greenhorn

Joined: Mar 08, 2005
Posts: 5
Sorry if it was unclear, but I don't want anyone to do it for me - that would defeat the whole point of this module I am doing

I will look into linked lists!
James P D Moore
Greenhorn

Joined: Mar 08, 2005
Posts: 5
Hmmm... just read that I cannot use linked lists or arrays - what do I use then? :s
James P D Moore
Greenhorn

Joined: Mar 08, 2005
Posts: 5
Just found out I can use primitive arrays like:

array1[index]
Sayed Ibrahim Hashimi
Ranch Hand

Joined: May 17, 2001
Posts: 148
To clear things up when I mentioned using a linked list, I did not mean java.util.LinkedList class. I mean you should read up what a linked list is and write the linked list class yourself. They aren't too complicated. Just google for "linked list" and you will find many tutorials on how to create one. Good luck.
 
jQuery in Action, 2nd edition
 
subject: Help Change Class Please
 
Similar Threads
struct in java
Question from jqplus
I am not getting the required output...
Exception -- java.lang.StackOverflowError
Sudoku Solver