This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Change Class Please

 
James P D Moore
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
James P D Moore
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James P D Moore
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... just read that I cannot use linked lists or arrays - what do I use then? :s
 
James P D Moore
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just found out I can use primitive arrays like:

array1[index]
 
Sayed Ibrahim Hashimi
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic