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 8642589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:48:53+00:00 2026-06-12T11:48:53+00:00

Hey guys can someone explain the big o notation for each of the following

  • 0

Hey guys can someone explain the big o notation for each of the following examples? Thanks in advance

Reading the element at index 28 in an array. Is this O(1)?
Comparing two ArrayList objects to determine if they contain the same elements (disregarding order, and without sorting). Is this O(n^2)?
Searching for a specific target value in an unsorted array. Is this O(n)

  • 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-12T11:48:54+00:00Added an answer on June 12, 2026 at 11:48 am

    1- Because array elements can be accessed randomly (no need to move from one cell to another like linked list) so you can basically say array[28] which is O(1)

    2- comparing two array list can done in a way which will lead to a a lower big-O But with sorting.

    You can sort each arraylist using mergesort or quicksort O(nlg(n)) then compare the two sorted lists in O(n). the result is O(nlgn).

    But another algorithm (without sorting) would iterate over each element in one array (n). And then checks whether the element is another array (n) (and marks it to handle duplicates properly). This latter algorithm is O(n^2).

    3- Yes it’s. You have to go through the whole list one by one till you find the desired element.

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

Sidebar

Related Questions

Hey Guys! Me again! Can someone provide me with some example code of how
hey guys, this might be really stupid, but hopefully someone can help. I'm trying
Hey guys, I'm wondering can someone help me out. I'm using javascript to serialize
Hey guys, thanks for all the help that you can provide. I need a
Hey guys how can I make an app keep playing an mp3 after pressed
Hey guys I'm trying to make a GUI which can navigate through JTextAreas when
Hey guys, this is simple but I can't make it workn... blah! I have
Hey guys i had an idea yesterday. Can you help me with this. Here
Hey guys, if anybody can help me out i'd love it... What i have
Hey, guys, I tried to ask this yesterday but I didn't explain myself clearly

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.