10000 GitHub - spero61/algorithm-practice: practice
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

spero61/algorithm-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithm Practice

Index:

  • Prime Factorization - C

    note
    Though this C-version is much faster than Python one,
    it still takes some time when the input number is significantly large.
    So I tried to pre-calculate prime numbers to speed up the process
    using the program, an excerption of the original, as follows:
    primes_to_file.c

    clang -o primes_to_file primes_to_file.c -lm
    ./primes_to_file 100

    primes.txt

    {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}
    

    The output file size, however, drastically increases as the input number grows.
    Therefore it is not reasonable to utilize precalculated prime numbers
    because it requires considerable storage memory.

    input num file size
    10,000,000 10 million 5,105KB 4.98MB
    100,000,000 100 million 49,902KB 48.7MB
    1,000,000,000 1 billion 490,196KB 478MB
    2,000,000,000 2 billion 999,104KB 975MB
    There is no space but a comma between numbers
    usage
    fact_usage_c.png

Simple implementation of Basic Data Structure

Etc

This repository is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license

About

practice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0