笨办法学python3续 learn more python in hard way ex13 单链表

这篇博客探讨了使用Python3实现单链表的过程,作者通过Zed Shaw的视频发现其思路与Java数据结构不同。博客介绍了push()、pop()和count()这三个关键方法的原理,并提供了zed在GitHub上的实现。博主分享了对代码的理解,并附有运行截图及个人手写笔记的电子版备份链接。
摘要由CSDN通过智能技术生成

首先说句mmp,看了zed的视频后发现,他的思路和我们学Java的数据结构不一样,可是他的方法也算一种实现

push的原理 图 #之前从代码推 现在我们从原理推
在这里插入图片描述
在这里插入图片描述

class SingleLinkedNode(object):
    def __init__(self,value,nxt):
        self.value=value
        self.next=nxt

    def __repr__(self):
        nval = self.next and self.next.value or None
        return f"[{self.value}:{repr(nval)}]"


class SingleLinkedList(object):

    def __init__(self):
        self.begin=None#头结点
        self.end=None#尾节点



    def push(self, obj
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Python进阶书籍,Transform Your Ideas into High-Quality Python Code! Zed Shaw has perfected the world’s best system for becoming a truly effective Python 3.x developer. Follow it and you will succeed—just like the tens of millions of programmers he’s already taught. You bring the discipline, commitment, and persistence; the author supplies everything else. In Learn Python 3 the Hard Way, Zed Shaw taught you the basics of Programming with Python 3. Now, in Learn More Python 3 the Hard Way, you’ll go far beyond the basics by working through 52 brilliantly crafted projects. Each one helps you build a key practical skill, combining demos to get you started and challenges to deepen your understanding. Zed then teaches you even more in 12 hours of online videos, where he shows you how to break, fix, and debug your code. First, you’ll discover how to analyze a concept, idea, or problem to implement in software. Then, step by step, you’ll learn to design solutions based on your analyses and implement them as simply and elegantly as possible. Throughout, Shaw stresses process so you can get started and build momentum, creativity to solve new problems, and quality so you’ll build code people can rely on. Manage complex projects with a programmer’s text editor Leverage the immense power of data structures Apply algorithms to process your data structures Master indispensable text parsing and processing techniques Use SQL to efficiently and logically model stored data Learn powerful command-line tools and skills Combine multiple practices in complete projects It’ll be hard at first. But soon, you’ll just get it—and that will feel great! This course will reward you for every minute you put into it. Soon, you’ll go beyond merely writing code that runs: you’ll craft high-quality Python code that solves real problems. You’ll be a serious Python programmer. Perfect for Everyone Who’s Already Started Working with Python, including Junior Developers and Seasoned Python Pr

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值