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

  • Home
  • SEARCH
  • 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 662173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:20:56+00:00 2026-05-13T23:20:56+00:00

As a learning excercise, I’ve just had an attempt at implementing my own ‘merge

  • 0

As a learning excercise, I’ve just had an attempt at implementing my own ‘merge sort’ algorithm. I did this on an std::list, which apparently already had the functions sort() and merge() built in. However, I’m planning on moving this over to a linked list of my own making, so the implementation is not particuarly important.

The problem lies with the fact that a std::list doesnt have facilities for accessing random nodes, only accessing the front/back and stepping through. I was originally planning on somehow performing a simple binary search through this list, and finding my answer in a few steps.

The fact that there are already built in functions in an std::list for performing these kinds of ordering leads me to believe that there is an equally easy way to access the list in the way I want.

Anyway, thanks for your help in advance!

  • 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-05-13T23:20:57+00:00Added an answer on May 13, 2026 at 11:20 pm

    The way a linked list works is that you step through the items in the list one at a time. By definition there is no way to access a “random” element in the list. The Sort method you refer to actually creates a brand new list by going through each node one at a time and placing items at the correct location.

    You’ll need to store the data differently if you want to access it randomly. Perhaps an array of the elements you’re storing.

    Further information on linked lists: http://en.wikipedia.org/wiki/Linked_list

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

Sidebar

Related Questions

As part learning exercise, part hobby project, I am implementing my own interpretation of
This is not homework, just a learning exercise on my part. I have been
Just started learning algorithms. So the exercise is to find if statement is always/sometimes
I am learning Java, now working with arrays. I am doing an excercise where
I am learning PHP and I am at this point learning how to validate
This app is a learning exercise for me using fragments, among other things. It
I'm new to OCaml and attempting to implement List.append as a learning exercise. This
This is a learning exercise in expression trees. I have this working code: class
I'm currently writing my own PHP framework as a learning exercise using the HMVC
So I'm working on my own little MVC framework as a learning exercise. It's

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.