Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9022897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:37:52+00:00 2026-06-16T05:37:52+00:00

I am trying to develop something like a Contact application where i need to

  • 0

I am trying to develop something like a Contact application where i need to add/delete/search/sort the Contacts. So, i’m using an ArrayList of MyContact objects as the data structure.

MyContact contains name and number, so to sort the ArrayList, I think it might be a time consuming task to look for a pattern in the ArrayList.

Currently i am traversing over each element and checking for the pattern.
I have tried to first sort the list but that too is time-consuming.

Please suggest any better way to search in arraylist or if I should switch to another data type, which i think at this stage would be little risky.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:37:53+00:00Added an answer on June 16, 2026 at 5:37 am

    Sounds like you are trying to optimize early. It’s a common stance in software development to make it work first and then, after identifying real performance issues, optimize. That said, you’re not asking for software development advice but programming advice.

    In terms of programming, you have two things to optimize here; performance and code.

    To keep the code clean, try to utilize frameworks/conventions that already exist rather than roll your own. Take a look at uses of the Comparable interface and Java’s Collections class. After that is the Apache Commons Collections library which has been an industry standard for some time. Google’s Guava seems to be replacing Commons Collections as the standard these days for a lot of reasons, most notable being better Generics support.

    As for performance, to sort or filter you need to either evaluate each record/object (at least once) for it’s correct order/inclusion in the results. The only real alternative to this is to ‘index’ your data prior to searching. For this the (Java) industry standard is Lucene but is very likely overkill for your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to develop web application (php/mysql), sort of blog site where ~10 posts
I'm trying to develop something like a remote desktop / VNC client. It's necessary
I am trying to develop an application for my localhost on which I can
I am trying to develop an application to forward received SMS to a web
I am trying to develop a mobile version of my web application and I
I am trying to develop a Windows Mobile 6 (in WF/C#) application. There is
Trying to develop using MVVM: I have this Csla.PropertyStatus control that is created in
I'm trying to develop my first site in ASP.Net using Web Forms. I have
I'm trying to develop a web based digital asset management application. I'm planning to
I'm trying to develop a invoice printing module for the application we're creating (in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.