<
查看: 1544| 回复: 3
收起左侧

[入门|算法|数据结构] CS61A 筹建2个月 自学小组

本楼:   👍  1
100%
0%
0   👎
全局:   23
100%
0%
0
公开课
学校名称: UC berkeley
Unit号: 12
开课时间: 2021-09-12
课程全名: CS61a_Fall_2020
平台: 其他
URL: https://inst.eecs.berkeley.edu/~cs61a/fa20/

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
我现在刚刚开始这个课程,如果你也打算从头到尾做一遍里面的作业和lab还有project,就加入我吧。vx:havefunday_9争取确定一个十人以内的小组。希望可以每周至少语音连线一次,讨论学习问题。实在是不想自己直接看答案解决。
我预计自己可以在11月中下旬结束学习,之后打算继续CS61B的课程。如果大家配合的好,就继续学下去。


上一篇:[OS] 开帖记录OS学习
下一篇:组队Udemy 刷JS课程 从beginner到Advance
 楼主| 老姚吉他毕业啦 2021-9-13 04:55:51 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   23
100%
0%
0
目前找到1位小伙伴了。继续寻找下一位。
回复

使用道具 举报

saintphoenix 2021-10-10 07:38:48 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   0
0%
0%
0
小白来请教一个lab02的问题
先把问题和答案发一下

def count_cond(condition):
    """Returns a function with one parameter N that counts all the numbers from
    1 to N that satisfy the two-argument predicate function Condition, where
    the first argument for Condition is N and the second argument is the
    number from 1 to N.

    >>> count_factors = count_cond(lambda n, i: n % i == 0)
    >>> count_factors(2)   # 1, 2
    2
    >>> count_factors(4)   # 1, 2, 4
    3
    >>> count_factors(12)  # 1, 2, 3, 4, 6, 12
    6

    >>> is_prime = lambda n, i: count_factors(i) == 2
    >>> count_primes = count_cond(is_prime)
    >>> count_primes(2)    # 2
    1
    >>> count_primes(3)    # 2, 3
    2
    >>> count_primes(4)    # 2, 3
    2
    >>> count_primes(5)    # 2, 3, 5
    3
    >>> count_primes(20)   # 2, 3, 5, 7, 11, 13, 17, 19
    8
    """
        def counter(n):
        i = 1
        count = 0
        while i <= n:
            if condition(n, i):
                count += 1
            i += 1
        return count
    return counter

小白一开始写成
    i = 1
    count = 0
    while i <= n:
        if condition(n, i):
            count += 1
        i += 1
    return count

结果报错,小白没想明白为啥需要在多套一个函数。求大神指点
回复

使用道具 举报

exexeiei 2021-10-11 06:01:03 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   0
0%
0%
0
我在学20fall这个版本,目前进度是sicp看到1.5,课程视频看到第二课,想一起学习可加微信:hanniballei
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表