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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:13:28+00:00 2026-05-16T17:13:28+00:00

Edit : Ok, since it’s clear I’m taking the wrong approach with this, I’ll

  • 0

Edit: Ok, since it’s clear I’m taking the wrong approach with this, I’ll explain what I was intending to do. The overall intent is to (as an exercise) verify all valid email addresses according to spec. This portion was to generate a portion of the data-set to verify the algorithm against.


As an exercise, I’m writing a program that will generate all possible email addresses. This will result in 808165 ≈ 1.4e122 possible items. I’m currently using List<T>s to store the generated items but my understanding is that it has a maximum capacity of Int32.MaxValue. I’m guessing a proper solution isn’t going to involve Lists of Lists of Lists. This is what I have so far.

private void GenerateLocalPart()
{
    List<string> validLocalSymbols = new List<string>()
    {
        ".", "!", "#", "$", "%", "&", "*", "+", "-",
        "/", "^", "_", "`", "{", "|", "}", "~", "\"",
    };
    List<string> validLocalNumbers = new List<string>()
    {
        "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
    };
    List<string> validLocalLowercase = new List<string>()
    {
        "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
        "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
        "u", "v", "w", "x", "y", "z",
    };
    List<string> validLocalUppercase = new List<string>()
    {
        "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
        "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
        "U", "V", "W", "X", "Y", "Z",
    };

    List<string> validLocalPartCharacters = new List<string>();
    validLocalPartCharacters.AddRange(validLocalSymbols);
    validLocalPartCharacters.AddRange(validLocalNumbers);
    validLocalPartCharacters.AddRange(validLocalLowercase);
    validLocalPartCharacters.AddRange(validLocalUppercase);

    List<string> targetSequence           = validLocalLowercase;
    int lengthOfStringToGenerate          = 5;
    int numberOfDifferentSourceCharacters = targetSequence.Count;
    List<List<string>> localPart          = new List<List<string>>();
    List<string> localPartSeed            = new List<string>();

    localPart.Add(localPartSeed);
    foreach (string character in targetSequence)
        localPartSeed.Add(character);

    for (int i = 1; i < lengthOfStringToGenerate; i++)
    {
        List<string> bufferList = new List<string>();
        localPart.Add(bufferList);
        foreach (string lastListString in localPart[i - 1])
            foreach (string character in targetSequence)
                bufferList.Add(lastListString + character);
    }

    Console.WriteLine("Break here.");
}

lengthOfStringToGenerate is a maximum length of the strings (so it generates all combinations from 1 to lengthOfStringToGenerate). localPart will end up with an amount of Lists equivalent to the lengthOfStringToGenerate. Is there a different type of collection that I should be using? Is there a different overall approach I should be taking?

  • 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-16T17:13:28+00:00Added an answer on May 16, 2026 at 5:13 pm

    Where were you expecting to store all this data? List<T> will always store its values in memory… but even if you write something to store the results to disk, you’re still not going to be able to hold 1.4e122 items. Have you really taken in just how big that number is? Even at a single bit per item, that’s way more than the capacity of the universe, if the whole of the universe was one big hard disk.

    The largest unit of data I’ve ever heard of being talked about in a meaningful way is an exabyte, which is 1018 bytes. For most people, a petabyte (1015 bytes) is a pretty huge amount of data. What you’re considering makes those quantities seem microscopically small.

    What are you trying to do with the data afterwards? And when would you expect such an algorithm to ever actually finish?

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

Sidebar

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.