![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法
Imagination丶
coding~
展开
-
【数据结构与算法】Python实现、堆、栈、数组、二叉树、链表、队列
1、把二叉树转换为双向链表:import syssys.setrecursionlimit(3000) # 修改最大递归深度为3000,默认为1000实际为998class BiTNode: def __init__(self): self.data = None self.lchild = None self.rchild = Noneclass Test: def __init__(self): self.pHead = None # 双向链表的头结点 s原创 2021-02-16 18:44:43 · 569 阅读 · 1 评论 -
【剑指offer】Python面试算法刷题汇总
1、把字符串转换成整数:# -*- coding:utf-8 -*-''' 函数功能:输入字符串转整数,不能使用str()和int()函数 'saaf12425' 返回0 '' 返回0 '124' 返回124 '+123' 返回123 '-321' 返回-321 '''class Solution: def StrToInt(self, s): # write code here原创 2021-02-16 11:32:43 · 549 阅读 · 2 评论