学习日记day45

Day45_1208

专注时间:5h44min朝着8H努力吧

每日任务:1h=二刷2道力扣hot100(完成情况及时长: 2道30分钟 );【学习资源:PyTorch官方文档:https://docs.pytorch.ac.cn/tutorials/beginner/basics/intro.html】1.5h=PyTorch工程实操(完成情况及时长: ?? );1h=周志华机器学习(完成情况及时长: 78分钟 );【按照Claude的路线】1h=手撕机器学习算法(完成情况及时长: ?? );计算机网络45分钟(完成情况及时长: ??

学完机器学习,然后是深度学习、搜广推经典模型(也有很多要手撕的,见Claude生成的)。学完PyTorch,之后是Transformer与大模型架构(见Gemini3pro生成的阶段2)。学快一点,学完还要做搜广推的实战项目。准备一个GitHub Repo把所有手撕过的算法整理进去,这会是最好的复习资料。

必须熟记的API、最简洁的GPT实现、带注释的Transformer实现、推荐系统模型库(包含主流模型实现)还有"Let's build GPT"系列学习视频见Claude的第20页。

学习内容: 如上,规划出了新的学习路线。

总结与心得: 周二不用写算法题了。第一道算法题写一遍就过,没有任何DEBUG和报错,不知不觉变强了,如果坚持学pytorch和推荐系统,那么这些方面的能力一定也能变强的,加油。但是发现递归算法还是弱,明天把这次二刷用到递归解法的题目的递归都重做一遍。

《19.删除链表的倒数第N个结点》

python 复制代码
# Definition for singly-linked list.
# class ListNode(object):
#     def __init__(self, val=0, next=None):
#         self.val = val
#         self.next = next
class Solution(object):
    def removeNthFromEnd(self, head, n):
        """
        :type head: Optional[ListNode]
        :type n: int
        :rtype: Optional[ListNode]
        """
        #一遍就过,我变这么厉害啦?
        #初始化时候fast指针先走n步。之后两个指针同时每次只走一步,但当fast.next = None时,需要删除slow所指的下一个指针(需要dummyhead),
        dummyhead = ListNode(0)
        dummyhead.next = head
        fast,slow = dummyhead,dummyhead
        while n:
            fast = fast.next
            n-=1
        while fast and fast.next:
            fast = fast.next
            slow = slow.next
        slow.next = slow.next.next
        return dummyhead.next

        

《24.两两交换链表中的节点》

迭代法和递归法

python 复制代码
# Definition for singly-linked list.
# class ListNode(object):
#     def __init__(self, val=0, next=None):
#         self.val = val
#         self.next = next
class Solution(object):
    def swapPairs(self, head):
        """
        :type head: Optional[ListNode]
        :rtype: Optional[ListNode]
        """
        #改了两句代码就通过了,无敌,现在链表变得好强,可能主要归功于草稿纸上手写吧
        if not head or not head.next:
            return head
        dummyhead = ListNode(0)
        dummyhead.next = head
        pre = dummyhead
        node1,node2 = dummyhead.next,dummyhead.next.next
        while node1 and node1.next:
            node2 = node1.next
            node1.next = node2.next
            node2.next = node1
            pre.next = node2

            pre = node1
            node1 = node1.next
        return dummyhead.next

        
python 复制代码
# Definition for singly-linked list.
# class ListNode(object):
#     def __init__(self, val=0, next=None):
#         self.val = val
#         self.next = next
class Solution(object):
    def swapPairs(self, head):
        """
        :type head: Optional[ListNode]
        :rtype: Optional[ListNode]
        """
        #递归思考一下
        #没节点或者只有一个节点
        if not head or not head.next:
            return head
        newhead = head.next
        #其余节点(第二个节点后面的节点)是 newhead.next,对它们进行递归
        head.next=self.swapPairs(newhead.next)
        newhead.next = head
        return newhead

        
        
相关推荐
一隅论数智2 天前
给AI一张“业务概念地图“:本体如何从哲学走向企业智能
大数据·人工智能·经验分享·笔记·学习·学习方法·政务
XiHongShi20162 天前
STM32F407 RTC定时器例程,建议保存
stm32·单片机·学习
爱吃苹果的日记本2 天前
离散数学第六课
学习·离散数学
AI职业加油站2 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
旖旎夜光2 天前
力控面试题 01.01: 判定字符是否唯一(位运算) —— 题解
c++·学习·算法·leetcode·力控
奇思妙想聪明勤奋的小羊2 天前
DeepAgents第5章:子Agent 与上下文隔离—让 Agent学会委派
人工智能·python·学习·语言模型
霍霍的袁2 天前
【C++】map 和 set 的使用 | 从用法到底层
开发语言·c++·学习·visual studio
彧azz2 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
我爱cope2 天前
【操作系统 | 计算机硬件:CPU、内存与 I/O 如何支撑操作系统?】
学习·操作系统