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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:18:16+00:00 2026-05-17T01:18:16+00:00

i need to write a template with Nodes containing data with 2 data structures

  • 0

i need to write a template with Nodes containing data with 2 data structures : a map and a minimum heap, both got the same nodes in it and every 2 same nodes are connected.
the problem is that i need the heap to know the node fields for the heapify for example, and i don’t know what’s the right way to do so, friends? public fields in Node? writing the Node inside the heap? using getters and setters?
thanks all for your help.

  • 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-17T01:18:17+00:00Added an answer on May 17, 2026 at 1:18 am

    Well, a linked list might be laid out like this:

    namespace my_namespace
    {
    namespace detail 
    {
    template <class T>
    struct Node
    {
        T value;
        Node* previous;
        Node* next;
        //constructors and other things that might help
    };
    }
    
    template <class T>
    class LinkedList
    {
    private:
        detail::Node<T>* head;
    public:
        //all it does    
    };
    }
    

    There is no particular reason to hide the Node struct from the user or the LinkedList class (putting it into a detail namespace should be more than enough): LinkedList needs it and the Node itself is pretty much useless to the user. All encapsulation is up to LinkedList to achieve: it just shouldn’t give out it’s head (or any other Node*).

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

Sidebar

Related Questions

I need to write a script in Matlab, which will read some data from
I need to write some input data files for a python program, and I
I need to write an XSLT template to identify a string of numbers. How
I need to write a container template class <T, R> where T is an
I'm making an template and I need to write a fully custom sql query.
When creating a template in Mako, I would need to write things like :
I need to write a system to generate HTML email from a data model
When I write class templates, and need to fully-specialize members of those classes, Doxygen
The application need write file's last modification date. void Dater(String DateFile) { File file
I need to write a C++ code coverage program that takes in another C++

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.