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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:22:40+00:00 2026-06-12T09:22:40+00:00

I am writing a program in C++ that requires IP addresses( all IPv4) to

  • 0

I am writing a program in C++ that requires IP addresses( all IPv4) to be looked up and stored in a fast way. Every IP address has a data associated with it. In case it already exists in the trie, I intend to merge the data of the IP address in the trie with the new addresses data. If it is not present, I intend to add it as a new entry to the trie. Deletion of IP address is not necessary.

In order to implement this, I need to design a Patricia Trie. However, I am unable to visualize the design beyond this. It seems quite naive of me, but the only idea that came to my mind was to change the IP address to their binary form and then use the trie. I am however clueless about HOW exactly to implement this.

I would be really thankful to you if you could help me with this one.
Please note that I did find a similar question here . The question or more specifically the answer was beyond my understanding as the code in the CPAN web site was not clear enough for me.

Also note, my data is the following format

10.10.100.1: "Tom","Jack","Smith"

192.168.12.12: "Jones","Liz"

12.124.2.1: "Jimmy","George"

10.10.100.1: "Mike","Harry","Jennifer"

  • 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-12T09:22:41+00:00Added an answer on June 12, 2026 at 9:22 am

    Patricia tries solve the problem of finding the best covering prefix for a given IP address (they are used by routers to quickly determine that 192.168.0.0/16 is the best choice for 192.168.14.63, for example). If you are just trying to match IP addresses exactly, a hash table is a better choice.

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

Sidebar

Related Questions

i am writing a program that requires me to scrape data from the screen,
I'm currently writing a java program that requires some Data to run. The data
I'm writing a program that requires the ability to list all applications installed, and
I'm writing a program that requires input in the form of a document, it
I am writing a Tkinter program that requires a loop. I can't run the
I have a problem: I am writing a program in Python 3.2 that requires
I am writing a program that requires a implementation of Medial Axis extraction, of
I am new to Perl and I am writing a program that requires the
I am currently writing a C program that requires frequent comparisons of string lengths
I'm writing a program using Xcode for school that requires we use the open()

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.