Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Code for Linear & Binary Search using ArrayLists

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Code for Linear & Binary Search using ArrayLists

    Hi,

    I was wondering if anybody can tell me how to write the code for linear and binary search using ArrayLists? I've been trying to find a code example online but haven't been able to find it.
    Thanks,

    Jen


  2. #2
    Junior Member
    Join Date
    Sep 2012
    Posts
    13
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Code for Linear & Binary Search using ArrayLists

    Help me understand your question, do you want to search an array using a binary search? I've never known binary searches to use array lists unless it takes the data it is to sort and puts it in an array list and sorts this new array...

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Code for Linear & Binary Search using ArrayLists

    Look at the Collections class. It has a lot of utilities for collection objects.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Need help to implement a solution with ArrayLists & Objects
    By IanSawyer in forum Java Theory & Questions
    Replies: 1
    Last Post: March 20th, 2012, 06:01 PM
  2. [SOLVED] Linear array search(without Arraylist)
    By Usoda in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 18th, 2011, 01:12 AM
  3. Binary Search Help
    By OwsumEmam in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 31st, 2011, 11:01 PM
  4. [SOLVED] Help with array of Strings...Linear Search?
    By Stockholm Syndrome in forum Collections and Generics
    Replies: 4
    Last Post: March 22nd, 2011, 03:31 PM
  5. Need help fixing Binary Search Tree code
    By fistpunch in forum What's Wrong With My Code?
    Replies: 6
    Last Post: December 6th, 2010, 11:22 AM

Tags for this Thread