Why am I doing this - in reference to Linked List Assignment
So I have a programming assignment to do for class, and in it the instructor wants us to write our own class for LinkedList. Upon browsing the java library I found that there is a java.util.LinkedList class with appropriate methods already defined. Is my instructor crazy or just outdated, I can see the point in writing one, to better understand the Linked List, but the one in the library is probably better anyway.
Is there a way to peek inside the code for java.util.LinkedList to at least get an idea of how I should start writing this class?
Thank You.
baftos wrote:
datawerd wrote:
So I have a programming assignment to do for class, and in it the instructor wants us to write our own class for LinkedList. Upon browsing the java library I found that there is a java.util.LinkedList class with appropriate methods already defined. Is my instructor crazy or just outdated, I can see the point in writing one, to better understand the Linked List, but the one in the library is probably better anyway.
Is there a way to peek inside the code for java.util.LinkedList to at least get an idea of how I should start writing this class?Yes, there is a way and, unlike others, I admire your approach. It's so refreshing after seeing all the 'do my homework' krapp. I call this reasearch, not cheating. Go to your JDK directory and open src.zip.
You will find there what you need. And by the way, peeking inside this zip would answer hundreds of questions,
Whenever I don't quite know how to do something, I try to find a similar API class and just see how Sun does it.
Edited by: baftos on Oct 16, 2007 10:46 PMYeah man, I'm with you on this one. I don't consider it cheating at all (given that you could find it on Wikipedia anyway), and I learn by example.
Apache taught me how to make an LRU cache the other day. Thanks Apache!
EDIT: To the OP: by the way, the LRU algorithm uses a modified linked list that I wouldn't have understood if i hadn't done my work in grade 12 / first year com-sci courses.
Edited by: endasil on Oct 16, 2007 8:12 PM
Similar Messages
-
When I import a commerical CD Itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the second album that it created. Why is itunes doing this and what can I do to combine them into one album?
I found this to be somewhat helpful: Grouping Tracks into Albums
What I did was to put in the same name for Album Artist in every track. That seemed to do the trick (previously all those fields were empty). It seems like a lot of work for a simple thing.
iTunes knows (or should know) that these tracks were imported from one CD. So why is it relying on incomplete data from the gracenote database? -
Mac OSX, 10.7.5, LR 5.6 After creating a new folder in the Destination section and importing images, the new folder name appears as 2010, no matter what name I give it. Why is it doing this?
I am experiencing Mavericks failing to copy subdirectories from usb sticks, I am backing up game saves from a console. Both sticks I use are fine, same permissions of course since the console wrote the files. Sometimes it copies, sometimes it doesn't. It seems to be related to the mounting process.
Thank God Apple hasn't (yet) broken bash. -
No matter how many times I start itunes on my pc I have to agree to the terms of service again and when it does open my settings have all been changed. Why is it doing this and how can I stop it? Reinstalling/repairing does not fix it.
McAfee AntiVirus by any chance? See the thread Why does iTunes delete my itunesprefs.xml?
Or it could be an issue with the SC Info folder. See TS1277 - iTunes: Missing folder or incorrect permissions may prevent authorization for details.
Or a repair install of iTunes from the Programs and Features control panel might fix the problem.
tt2 -
I just recently upgraded from a 4S to a 5C. I backloaded the 5 from Itunes and now everytime i plug into itunes, it asks if I want to set up as new or restore from a previous backup. Why is it doing this. I did it twice yesterday..... In addtion, those are the only options I have. I cannot do anything else unless I choose one of the two. Zero options. Phone works fine though.
I figure that either of those options will result in losing all SMS and data created since the last backup. Not a major loss, but ** annoying when nothing has changed and the time it will take to restore.
When was the last time you synced your iPhone with iTunes since the backup is updated as the first step during the sync process?
Is there anyway to recover this WITHOUT having to do a full restore or set up as new?
In a word, no.
If I do restore or set up as new, how do I know it's not going to do the same thing tomorrow (like a few other forums threads I've read indicate might happen)?
There is no way to know for certain but I've never experienced the same in the first place. I venture to say having to do this is the exception rather than the rule. -
I just updated my iphone to IOS 7 and cannot get my imessage to work, it keeps saying "waiting for activation" nothing i have read online has helped me try to fix the problem. why is it doing this and how can i fix it?
Here's a good troubleshooting article about imessage "waiting for activation".
http://support.apple.com/kb/TS4268 -
Every time I enable 3G I get 'No Service', why is it doing this?
Every time I enable 3G I get 'No Service', why is it doing this?,
But then sometimes it will get service but i cant use my 3G, only Edge works
Any Help is appreciated
Thanks in AdvanceThe most likely reason is that your carrier is not providing 3G service in the area where you're located. Contact your carrier for coverage details.
-
Why does the Video do this? Why is iMovie doing this all of a sudden
http://www.esnips.com/doc/407a5579-501f-44a4-ad41-789684ea36ca/GIf-Remastered-Co medy-2
WAtch it. near the beginning, the video just freezes and my vid has a lot more.
Why is it doing this in imovie and how can I fix this?
I used mov and mp4 and they bot h did this. I made 2 other videos last night and it didn't od this. This one did.
I tried all thes tuff but it freezes in the video. I don't know why but it happens. how can I fix thi?Hi M
That the Video freeses can have many origins. Most common is:
- less than 5Gb free space on internal hard disk
- use of external hard disk that is formatted FAT32 /DOS/UNIX/Mac OS Exchange
should be: Mac OS Extended or Mac OS Extended (journaled)
- other background processes running: Screen/Energy savers, photo as desktop
backgroud - even worse if it changes every 5th second
If You got > 25Gb free, no ext. hard disk and a clean desktop:
Deleting iMovie pref file - should help
iMovie
-->/Users/YourName**/Library/Preferences/com.apple.iMovie.plist
and
-->/Users/YourName**/Library/Preferences/com.apple.iMovie3.plist
AND I would also
- Run: Repair permisions: Apple Disk Util tool (on hard disk/Applications/Tools/Disk Util tool
and I would also
- Run: Repair hard disk: Apple Disk Util tool - to do this You need to start from
CD/DVD or external hard disk !
Yours Bengt W -
My iPhone says "o death" where the date should be on the lock screen, why is it doing this and how do I get the date back?
I tried powering off and on and it went away, but I can't tell if it's been broken into since everything works fine (I'm using it now) is there a test to see if it's been broken into?
Thanks for all your replies! -
So basically i set a passcode and forgot it.. I want to restore my iphone. It's an iphone five and currently the software is all up to date. However whenever I try to restore it, I get this message that it's contacting the apple software server and then it begins downloading i.os which takes up to 5 hours. Why is it doing this?
The only way to deal with a forgotten passcode is to restore the phone.
iOS: Forgotten passcode or device disabled after entering wrong passcode -
Hi all, when I try to purchase items in a game on my iPad it comes up with a message saying contact iTunes support to complete this transaction? What does this mean and why is it doing this?
It means exactly what it says:
Contact itunes support
It is saying this because you need to contact itunes support.
Have you considered doing what it told you to do? contact itunes support -
iMac is asking for admin login password upon startup when it never did before, settings are still on auto login. Why is it doing this out of the blue?
Is sounds like it might for some reason booting into Safe Mode, which does prompt for a password.
Try a PRAM reset:
Shut down the computer.
Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
Turn on the computer.
Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
Hold the keys down until the computer restarts and you hear the startup sound for the second time.
Release the keys.
If that doesn't help, restart holding down the option key which should take you to the startup manager. Select Macintosh HD (you may need to use the arrows on the keyboard if the kb is Bluetooth), tap 'enter'. Does it boot normally now? -
the past few weeks my iphone 3gs is randomly telling me i need to plug it into iTunes and will not let me use my phone util i do. Then it makes me restore it all over again. This happens around once a day. why is it doing this?
Hi, beth.lau.gr.
Thank you for visiting Apple Support Communities.
I understand you have been experiencing issues with your iPhone restarting and showing you a blue screen. I wont be able to give you an exact answer as to why this is happening. However, this is the most relevant troubleshooting article for this issue. This article also provides options to reach out to us via phone for additional assistance.
If your iOS device restarts, displays the Apple logo, or powers off while you're using it
http://support.apple.com/en-us/HT203899
Cheers,
Jason H. -
I'm having an unusual problem with my iphone 4S. When I'm making a call, it suddenly sounds like my call has been invaded by aliens! Why is it doing this? I'm also having problems sending texts. Sometimes it sends sometimes it doesn't. What is going on? Can it be fixed? I'm really not liking this new phone!!!!
Could be an issue with your Carrier and/or location...
The Basic Troubleshooting Steps are:
Restart.. Reset.. Restore from Backup... Restore as New...
Try a Reset...
Press the sleep/wake button & home button at the same time, keep pressing until you see the Apple logo, then release the buttons...
http://support.apple.com/kb/ht1430 -
I have purchased a tv series and it only downloads half the series. I don't know what's going on. It's don't it with a couple of tv series. Why is it doing this? How can I stop it?
Check your receipt for the purchase for the "report a problem" link.
Maybe you are looking for
-
Call custom generic-searchbackend-config.xml by a specified scenario
Hi Everyone, this is a continue of Re: limit options for Search For dropdown list on Transaction tab: I need to add a specified scenario condition for limiting Search For dropdown list. Can anyone advise me how to? Thanks, Jin
-
Is there a way to send to MBP screensaver to the Apple TV? I like the fireplace and acquarium.
-
Oversea opportunity in SD/XI/BW.
Hello all, Am an ABAPer with one and half years of experience. 1)Which one of these three is best so that i a have maximum onsite(oversea) opportunities and my ABAP knowledge is utilised. 2)Can somebody tell me how and to what extend(Percantage wise
-
RSS Feed causes elements to diplace?
I am working on a site ( http:www.insurance-comparisons.info ). Every time I put in the PHP coded, rss feed, generated by a program called RSS Content Builder in my page the other elements get displaced. I am very new to dreamweaver and this is givin
-
EIS - OLAP Model - Dimension Joins
Hi, I know the in EIS OLAP model we need to build a logical STAR schema between dimensions and fact tables with some join condition. Now, can you tell me how the join works while building the dimensions? Do EIS really bother about the joins between d