{"id":21975594,"url":"https://github.com/rogerchern/algo_dbb","last_synced_at":"2025-03-22T23:43:37.008Z","repository":{"id":83992152,"uuid":"69532546","full_name":"RogerChern/algo_dbb","owner":"RogerChern","description":null,"archived":false,"fork":false,"pushed_at":"2016-09-29T23:50:16.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-28T03:28:08.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RogerChern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-29T05:04:49.000Z","updated_at":"2016-09-29T14:17:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"624ea456-1eb3-482d-84c9-4641335c0d30","html_url":"https://github.com/RogerChern/algo_dbb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerChern%2Falgo_dbb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerChern%2Falgo_dbb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerChern%2Falgo_dbb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerChern%2Falgo_dbb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RogerChern","download_url":"https://codeload.github.com/RogerChern/algo_dbb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245036122,"owners_count":20550661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T15:57:23.618Z","updated_at":"2025-03-22T23:43:36.981Z","avatar_url":"https://github.com/RogerChern.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"### 算法设计第一次作业\n陈韫韬 201618014628014\n\n#### 第11题 Karatsuba\n##### 编译环境\nTarget: mingw32\nConfigured with: ../src/gcc-5.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads=posix --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls\nThread model: posix\ngcc version 5.3.0 (GCC)\n\n#### 测试方法\n```\ncmake .\nmake\n./a.out\n```\n\n##### 算法分析\n测试方法：输入一个随机生成的长度为 n digits的高精度数，n=250, 500, 1000, 2000, 4000, 8000, 16000，分别利用 karatsuba 算法和 grade school 算法计算其平方，记录两个算法耗时。\n\n测试结果：\n\n|n  |karatsuba(ms)|ratio1|grade school(ms)|ratio2|\n|---|---      |---         |---|---|\n|250|104|-|3|-|\n|500|333|3.2|10|3.3|\n|1000|1020|3.1|35|3.5|\n|2000|3342|3.3|134|3.8|\n|4000|11438|3.4|533|4.0|\n|8000|39928|3.5|2126|4.0|\n|16000|142781|3.6|8555|4.0|\n\n由测试结果可知 karatsuba 渐进复杂度小于 grade school 算法，但由于自行实现的Int高精度类的减法运算(karatsuba中需要减法，grade school不需要)没有经过优化，karatsuba 算法实际用时远远大于 grade school 算法。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogerchern%2Falgo_dbb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogerchern%2Falgo_dbb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogerchern%2Falgo_dbb/lists"}