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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:05:34+00:00 2026-06-05T08:05:34+00:00

[ [ [2,33,64,276,1], [234,5,234,7,34,36,7,2], [] ] [ [2,4,5] ] . . . etc ]

  • 0
[
   [
      [2,33,64,276,1],
      [234,5,234,7,34,36,7,2],
      []
   ]
   [
      [2,4,5]
   ]
   .
   .
   .
   etc
]

I’m not looking for an exact solution to this, as the structure above is just an example. I’m trying to search for an ID that can be nested several levels deep within a group of IDs ordered randomly.

Currently I’m just doing a linear search which takes a few minutes to get a result when each of the deepest levels has a couple hundred of IDs. I was wondering if anyone could suggest a faster algorithm for searching through multiple levels of random data? I am doing this in Python if that matters.

Note: The IDs are always at the deepest level and the number of levels is consistent for each branch down. Not sure if that matters or not.

Also to clarify the data points are unique and cannot be repeated. My example has some repeats because I was just smashing the keyboard.

  • 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-05T08:05:35+00:00Added an answer on June 5, 2026 at 8:05 am

    The fastest search through random data is linear. Pretending your data isn’t nested, it’s still random, so even flattening it won’t help.

    To decrease the time complexity, you can increase the space complexity — keep a dict containing IDs as keys and whatever information you want (possibly a list of indices pointing to the list containing the ID at each level), and update it every time you create/update/delete an element.

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

Sidebar

Related Questions

I'm trying to translate this LinearGradient <s:LinearGradient rotation=90 scaleX=44.2931 x=10.294 y=-0.276 > <s:GradientEntry color=#FFD500
How do you parse this json: a:1:{i:3;a:3:{s:8:routtype;s:9:Alpha SS7;s:6:credit;d:4532.600000000000363797880709171295166015625;s:8:validity;s:3:276;}} to php object or array? Tried
This is my logcat and the problem is that the application is force closing
I got this error messages while I am trying to deploy my django app
I'm having trouble converting this 5 star rating script that works perfect with jquery
I have an application that I'm trying to wrap into a jar for easier
I'm looking for an app or a script (web service) that can clean up
I work with a few different X12 standard EDI transactions (270/271, 276/277.) I thought
I would like to take the following array and generate a new array that
I have a website that is being served by nginx and django. My staging.py

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.