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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:43:45+00:00 2026-06-18T00:43:45+00:00

I am trying to implement some kind of algorithm for my research paper(programming is

  • 0

I am trying to implement some kind of algorithm for my research paper(programming is not my major field of research) and I need some help. Consider following kind of data structure (e.g a and b) where we have a linear time line and objects placed on this time axis at certain distance from each other (actually these objects represent data packets whose width is equal to time needed to transmit the packet). I want to align them on right side, making it our reference point (time t=0) and then merge these two lists (a and b), if i may call them a list, and get a resulting list as shown in c. The overlapping objects are shifted to make single list and gap between these objects changes accordingly. Any idea how should I proceed? Linked lists? (if they exist in python). there can be more than two lists to be merged in a single list. Thanks in advance

       ____          _____            ____
    __| a3 |________| a2  |__________| a1 |  (a)

       ____             _____         ____
    __| b3 |___________| b2  |_______| b1 |  (b)


            ____  ____     ______  _____   ____  ____
    _______| a3 || b3 |___| a2   || b2  |_| a1 || b1 |  (c)
  • 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-18T00:43:47+00:00Added an answer on June 18, 2026 at 12:43 am

    For example, dict for data items and lists for data sequences:

    data 1:

    [{‘start’:0, ‘t’: 10, ‘dtype’: ‘a’}, {‘start’: 30, ‘t’:20, ‘dtype’: ‘a’}, {‘start’: 50, ‘t’:30, ‘dtype’: ‘a’}]

    data 2:

    [{‘start’:15, ‘t’: 10, ‘dtype’: ‘b’}, {‘start’: 40, ‘t’:20, ‘dtype’: ‘b’}, {‘start’: 50, ‘t’:30, ‘dtype’: ‘b’}]

    and merged list (sorted by start time):

    sorted(data1+data2, key=lambda x:x['start'])
    

    result:

    [{‘start’: 0, ‘t’: 10, ‘dtype’: ‘a’}, {‘start’: 15, ‘t’: 10, ‘dtype’: ‘b’}, {‘start’: 30, ‘t’: 20, ‘dtype’: ‘a’}, {‘start’: 40, ‘t’: 20, ‘dtype’: ‘b’}, {‘start’: 50, ‘t’: 30, ‘dtype’: ‘a’}, {‘start’: 50, ‘t’: 30, ‘dtype’: ‘b’}]

    For backorder use parameter ‘reverse=True’ in sorted function. To find overlapped elements you just check during list iteration if item[‘start’] + item[‘t’] > nextitem[‘start’] ===> items overlapping, and you must adjust nextitem start position according your algorithm.

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

Sidebar

Related Questions

I am trying to implement some kind of new Linux task scheduler so I
I'm currently trying to implement some kind of search system in a program of
I'm trying to implement some kind of 'multiprocessing' in php for my task. The
For a WCF project I'm working on, I need to implement some kind of
I want to write a some kind of supervisor and I'm trying to implement
I'm trying to implement some kind of drag and drop snap to grid similar
Currently I'm trying to implement some kind of object stream, similar to the structure
I am trying to implement some kind of background task queue in Django, because
I am trying to implement some kind of Zoom/Pan features to maps generated with
I am trying to implement some flow control in Play 2.0.3, kind of a

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.