会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Loading
lif323
博客园
首页
新随笔
联系
订阅
管理
2017年4月27日
算法导论(Introduction to Algorithms)exercises 5.1-3代码实现Unblased_random
摘要: int blased_random() {//返回1的概率为0.1,返回0的概率为0.9; return rand() % 10 > 8 ? 1 : 0; } int unblased_random() {//等概率返回1,0; int a = 0, b = 0; for (;a == b;a =
阅读全文
posted @ 2017-04-27 10:19 lif323
阅读(318)
评论(0)
推荐(0)
公告