determinded if a number is a prime
2016-03-21 22:04
225 查看
1. alorighm one : by uisng the defination of the prime. scanf the 2---n-1,
improving :traveral 2-sqrt(n).
2.alorighm two ;find the prime, and set a list(array) to save it .when you need to judgment
wether the number is prime . find the list .
there are two problem need to solve :
1. you need to get a efficent way to find prime.(快速筛选法)
1.is _prime[i]=ture; 2. start with 2--sqrt(n)
2.reduce the size of the prime list.(位图数据结构)
improving :traveral 2-sqrt(n).
2.alorighm two ;find the prime, and set a list(array) to save it .when you need to judgment
wether the number is prime . find the list .
there are two problem need to solve :
1. you need to get a efficent way to find prime.(快速筛选法)
1.is _prime[i]=ture; 2. start with 2--sqrt(n)
2.reduce the size of the prime list.(位图数据结构)
相关文章推荐
- jQuery全屏滚动插件fullpage.js
- 微软云平台媒体服务实践系列 1- 使用静态封装为iOS, Android 设备实现点播(VoD)方案
- 华为OJ--求n!末尾含有0的个数
- c++的类的理解
- PB中一些技巧
- codevs 1297 硬币
- 微软云平台媒体服务实践系列 2- 使用动态封装为iOS, Android , Windows 等多平台提供视频点播(VoD)方案
- Section 2.4 图&章末总结
- 数组的顺序存储表示
- 微服务(Microservice)那点事
- test
- Linux awk工具 简介
- [UI] 精美UI界面欣赏[13]
- 阅读下面程序,请回答如下问题
- 学习笔记之Linux Shell脚本教程:30分钟玩转Shell脚本编程
- kmp算法总结
- 作业C#程序分析
- test1
- 候选人得票统计程序
- TCP/IP