Justification for using HashMap and not ArrayList

Hi, I've recently completed a project for my course and now I'm doing the write up for it. Part of my project was to load a dictionary into a data structure. I went with a HashMap because I had code from a previous project to help implement it, the dictionary was used to check possible decrypted words and return possible words that the half decrypted word could be.
Now I should justify my use of HashMap v ArrayList. Time complexity of ArrayList is better than the hashmap if im correct, so are there any 'technical' reasons I could say why I chose the HashMap:
ArrayList O(1)
HashMap O(n)
So searching 50,000 + words would be best using an arraylist? Could anyone possibly give a good reason why hashmaps would be better than arraylists?

Linear searching is (generally) the slowest way to find something.
If you know the exact location of what you're looking for, then obviously just accessing it using an ArrayList would be fast. Using a HashMap you can, by using the input key, figure the index of the bucket which contains your data, so you don't have to linearly search through the whole map just to find what you're looking for, your key gives you it's location.
I'm sure these links can explain stuff better than I did:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html

Similar Messages

  • HT4191 iPhone Local Storage "My iPhone" - How do you create this folder for use by the Notes app on a iPhone or iPad?  If I want to keep some notes only on my device and not in a cloud environment associated with an e-mail account.

    iPhone Local Storage "My iPhone" - How do you create this folder for use by the Notes app on a iPhone or iPad?  If I want to keep some notes only on my device and not in a cloud environment associated with an e-mail account.  I've seen reference to the  "My iPhone" local storage put no mention on how you create this folder or access this folder within the Notes app.  I realize storing information in a local storage like this provides no syncing between other iDevices but that is exactly what I'm looking for.  I'm running iOS7.0.4 on a iPhone 5S, and a iPad Air.  Any help would be greatly appreciated.

    If you go to Settings > Notes > Default Account you will see "On My iPhone" as the default account and the only choice if you have not enabled syncing Notes in Settings >iCloud or Settings > Mail, Contacts, Calendars. If you have enabled syncing you can still select "On My iPhone" as the default account. When you are in the Notes app you won't see any accounts listed if you have not enabled syncing because they are all in the On My iPhone account and that is the only place possible. It is not a folder that you create.

  • Can i use an iphone for a ipod and not activate the phone

    Can I use a IPhone 5 for a IPod and not activate the phone feature?

    i brought it from ebay, iphone 5 sprint,
    MD656LL/A

  • I have two iphones using the same computer and I can only find a backup for my iphone and not my girlfriends.  She uses itunes a lot more often then I do but cant find it

    I have two iphones using the same computer and I can only find a backup for my iphone and not my girlfriends.  She uses itunes a lot more often then I do but cant find it.  Really need some help.  Shouldnt her apps and details be saved online in the itunes store?  Even her apps wont appear

    If you create an Apple ID for your daughter, signing out of the existing Apple ID with the iTunes & App Store on her iPhone will not change anything on your iPhone.
    All apps include DRM protection which is tied to the Apple ID that was used to download the apps.
    If she starts using her Apple ID to download apps, when there is an app update for an app on her iPhone that was downloaded with the current shared Apple ID, she will need to use that Apple ID and password to download the app updates.

  • Dunning form F150- Telefon/fax/mail printing for 1 user and not for other

    Hello expert,
    This is regarding the printing of the dunning form using F150. 
    At first, using company code and account clerk (BUSAB), we retrieve the user id.  The program uses FM BAPI_USER_GET_DETAIL to get the address details of this user id.  The user name, telephone and fax adn email are printed in the dunning form (1st reminder, 2nd reminder and so on).  The problem here is , the address details are printed on the form for one user and not for the other user who is processing.  Any idea regarding this.  Do I need to give any user setting parameter in SU01 or is there any authoriztaion issue which is blocking this.  Awaiting reply,
    Cheers,
    Bala

    I'm having the same problem with Exchange 2003, I can get it to work with Entourage and on my iPhone, but it keeps rejecting my password on Mail.app. If I keep entering the password it starts to update with server, but it won't save the password. IMAP is on for my account which is how it works on iPhone.
    I'm starting to think it has something to do with Keychain Access or Mail.app and not so much Exchange Server. If anyone has found a solution please let me know,
    Thanks

  • How can I get my data from a old iPad to a new iPad using iCloud and not iTunes

    How can I get my data from a old iPad to a new iPad using iCloud and not iTunes

    Restore from the iCloud backup - assuming that you were backing up to iCloud in the first place. If you weren't using iCloud for backup - then you are out of luck.
    If you were backing up to iCloud - you have to erase all contents on the iPad in Settings>General>Reset>Erase all content and settings - before you can restore from the iCloud backup.
    Read this article before you do anything else
    http://gigaom.com/apple/ios-101-set-up-and-restore-from-icloud-backup/

  • The condition record for use B can not be displayed

    Hi gururs,
    What does this message (number : VE896 ) mean ?
    How to make it desapear ?
    P.S : it's about output type for purchase orders.
    This message is displayed when I click on : "Goto -> Determi analysis" in tcode ME22N.
    Regards,
    Bahia.

    Hi
    It means you are trying to veiw the executed condition record. System found the condition record for entered transactional data which you cannot see by clicking on it (when you see green record in condition analysis).
    For given condition type -> and access sequence/ access - system shows the condition record that is determined. You can see its details by clicking the access which shows the message that condition record has been found with its determined parameters.
    Ex: For batch determination I have set up one search strategy with a condition type (with access sequence). I created one condition record. When creating say sales order -batch determination takes place based on condition record parameters. System shows a green light for determined condition record. You cannot see its details - if you try to see then system issues a message like ''The condition record for use B can not be displayed''. If you want to see click on its immediate predecessor (access ).
    Thanks

  • Is there example code for using Ni488 and PCI-GPIB card in non controller mode?

    Is there example code for using Ni488 and PCI-GPIB card in non controller mode?

    cymrieg,
    Your code looks good to me. What is the problem? What happens when it fails? What is the IBSTA value on the controller, and at what point in the code does it stop? What is the IBSTA value on the slave, and at what point does it stop?
    One thing is that you might not want to call IBCLR() in a loop on the device. At the beginning of the program is fine...This will send a clear command to the device and will clear out any LACS and TACS bits that might be set. Also your IBDEV call shouldn't be in a loop.
    Hope this helps, but let me know if you need more information.
    Scott B.
    GPIB Software
    National Instruments

  • Is there a video tutorial for using cyberduck and iweb?

    So, is there a video tutorial for using cyberduck and iweb to upload to a website? The written instructions on iweb are not specific enough.

    Might be worth posting that in the iWeb forum.
    http://discussions.apple.com/category.jspa?categoryID=188
    This is the iPhoto 09 forum.
    Also, have you tried searching with google?
    Regards
    TD

  • Expert secrets for using RMAN and Data Pump by kamran agayev and Aman Sharm

    Hi ,
    Is this book available in INDIA:
    Expert secrets for using RMAN and Data Pump by kamran agayev and Aman Sharma
    How can i get this book in India.
    Thanks,
    Alok
    Edited by: user12141893 on 6 Apr, 2012 11:25 AM
    I tried to buy this book online from rampant's official site but shipping cost was more than cost of book.
    Book is not available on Flipkart and Amazon also

    Helios,
    OP can send a mail to me too :-) .
    OP,
    We are in talks with the publisher. In India, the book would be by another partner publisher and details of it I shall be updating when would be available. Thanks for the interest in our book.
    Aman....
    PS: This is a technical forum and is not meant for such topics. Please discuss by communicating with Kamran and me over email personally. Let's keep the forum for the very purpose it is meant for-technical discussions.

  • Setup of Inspection Lots for some vendors and not for all

    Hello,
    We do have a situation where in the business wants Inspection Lots to be set up for some vendors and not for some vendors - for the same material.
    What it means is, for Material XXXXX001, Vendor 00003 needs inspection during GR for Purchase Order and Vendor 00005 and 00006 should be set up for Non Inspection upon GR and stocks should be posted to Unrestricted.
    Any suggestions / options are welcome.
    Thanks
    Kris

    Hello,
    You can use vendor q-info records to handle this... deactivate the goods receipt inspection on the vendor(s) that do not require incoming inspection.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/c6/b9b3341a933f50e10000009b38f83b/frameset.htm
    Regards,
    John

  • Why wont apple accept the fact that 4.0 is for iphone 4 and not for 3gs?

    Having all those problems said with 3g/s running on iOS 4.X why wont they let us just downgrade back to 3.1.3 officially until they find a way on how to solve issues with 3g/s?
    About the downgrade method of life hacker, if you're really not good in those things you might actually ruin your pc like my friend who tried it, she lost her wifi on her notebook, i had to help her find the installer of the driver again. this happened after she tried to install that libusb that is needed to run the application for exit recovery mode and other stuff.
    Yes iOS 4.1 is out but contacts disappearing? And who knows what more problems it brings. I was even peeking around the iphone 4 forums it seems that they are not doing well either.
    Anyway mine is all fine except that im afraid to use wifi or any apps that needs internet connection because everytime i do, my 3gs gets very very hot. I have already done the basic solution suggested by apple (factory reset, start from new iphone) but its still the same.
    And another thing, the multitasking is getting annoying, you have to manually close all apps in the 'multitasking background' everytime you decide to quit an app. I guess they should put a 'Disable multitasking' or something like that.

    Firenzo wrote:
    Why wont apple accept the fact that 4.0 is for iphone 4 and not for 3gs?
    Because it works beautifully in the 3GS, with better battery life, faster operation and some great new features.
    Having all those problems said with 3g/s running on iOS 4.X why wont they let us just downgrade back to 3.1.3 officially until they find a way on how to solve issues with 3g/s?
    If you are having problems it is NOT from 4.0; there is something else wrong with your phone. There are plenty of troubleshooting tips in the forum if you look.
    And another thing, the multitasking is getting annoying, you have to manually close all apps in the 'multitasking background' everytime you decide to quit an app. I guess they should put a 'Disable multitasking' or something like that.
    NO YOU DO NOT. Those apps in the ribbon are not multitasking, they are suspended. You can ignore them and they won't hurt battery life or memory, unless they are streaming apps like Pandora.
    It's amazing. For 3 years people screamed about the fact that the iPhone didn't support multitasking. Now they scream because the phone DOES multitasking. You can't win.

  • Is there a way to do a spelling quiz in captivate using images and not questions as reference.

    Is there a way to do a spelling quiz in captivate using images and not questions as reference. Specifically i want have blank lines underneath an image, where the user looks at the image and types the correct letters to fill in the blank. For example a picture of a dog, with this _ _ _ underneath for the user to fill in, or in some cases perhaps having them fill in the vowel like so "d_g".I must have audio with this , as the students will be able to listen to the audio sound out the word phonetially to help them be able to type it!
    Appreciate any advice! Cheers!

    Hello everybody!
    This widget is great!! Thank you for that!!
    I searched for something like that earlier and made an other workaround:
    http://forums.adobe.com/message/1912430#1912430
    The Javascript did not work in my test. I brought to the "if you reach this slide" feature but it failed.
    Regards,
    Markus

  • HT1665 how do i found out if a company is certified manufactury (made for iphone) chargers and not fake.

    how do i found out if a company is certified manufactury (made for iphone) chargers and not fake.

    It is not possible to confirm that an adapter is genuine by inspecting its exterior, and inspecting the interior to identify engineering shortcomings that differ from Apple's design destroys the power adapter.
    Many counterfeit adapters can be identified through obvious misspellings on their case, but the only way to be absolutely certain you are using a genuine Apple power adapter is to purchase it from Apple or an authorised Apple reseller. Counterfeit and potentially dangerous power adapters bearing fraudulent consumer product safety agency approval markings are very common.

  • Using NULL and NOT NULL in prompted filters

    Dear all,
    While trying to grap the concept of prompted filters in sap bo web intelligence, I had a question whether why we cannot use NULL and NOT NULL while creating a prompted filters in our report.

    HI,
    'Is Null' and 'Not Null' are the predefined functions in webi which only eliminate the null values or considering only null values.
    'Is Null' and 'Not Null' are itself predefined functions that why you are not getting  prompts.
    Null values are standard across the databases so this is defined  as a function in webi to specific eliminate the null values.
    If something is not standard then there is option in the webi to use different operator with static values or with prompts.
    More more information on Null see the Null wiki page.
    Null (SQL) - Wikipedia, the free encyclopedia
    Amit

Maybe you are looking for

  • Error in creation of sales order bu using BAPI_SALESORDER_CREATEFROMDAT2

    Hi , I am trying to create sales order by using bapi. after passing all the parameters to bapi iam getting message as shown below. SALES_HEADER_IN has been processed successfully              SALES_ITEM_IN has been processed successfully             

  • How do you get the Java API onto Computer

    Hi guys, Well I want to practice Java at home, but instead have been staying up late at night at the University's Computer Lab. I have downloaded the Forte for Java, but I don't need all the Graphics classes since my programming class is centered on

  • Syncing issues post laptop restore.  Need some help with getting media back off phone and into itunes again

    I recently had to restore my HP laptop.  After the restore, i re-installed itunes and can now not get all media on my iphone to re-sync back into itues..  any tips?  I have all files backed up from laptop pre-restore, yet cant get this to work. any t

  • Back up from iPhone 4 to iPhone 5 not working

    Hi Guys, I have been using an iPhone 4, doing regular backups. My son bought me a iPhone 5 and I did a restore from iTunes as I need the text messages from the iPhone 4. I have now done a complete restore on the iPhone 5 as every time I restore a bac

  • Unable to properly uninstall adobe reader 10.0.1

    I have run the uninstaller from programs and features. However all the software is still listed under the program files. I am still able to open adobe reader. It still has all of its features. Even the shortcuts work. The registry is littered with ad