Data Structure
Minkowski_lin
这个作者很懒,什么都没留下…
展开
-
顺序表操作
顺序表操作code存放在h头文件中,调用即可#include<iostream>const int MAXSIZE=100;using namespace std;//定义顺序表结构typedef struct{ //define structure int *a; int len; int listsize;}List;void I...原创 2018-08-30 17:48:44 · 166 阅读 · 0 评论 -
LeetCode141. 环形链表(快慢指针)
LeetCode141. 环形链表(快慢指针)快慢指针参考https://zhuanlan.zhihu.com/p/30990994?utm_source=qq&utm_medium=social&utm_oi=1080275092017270784# Definition for singly-linked list.class ListNode(object): ...原创 2019-03-06 23:17:35 · 262 阅读 · 0 评论 -
LeetCode112.路径总和
LeetCode112.路径总和version 1# Definition for a binary tree node.class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = Noneclass Solution: ...原创 2019-02-27 09:46:06 · 122 阅读 · 0 评论 -
LeetCode104.二叉树的最大深度 (BFS)+(递归)两种方法
LeetCode104.二叉树的最大深度 (BFS)+(递归)两种方法BFS# Definition for a binary tree node.class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None ...原创 2019-02-26 15:52:07 · 490 阅读 · 0 评论 -
LeetCode111. 二叉树的最小深度 (BFS) + (递归)两种方法
LeetCode111. 二叉树的最小深度 (BFS) + (递归)两种方法BFS# Definition for a binary tree node.class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None ...原创 2019-02-26 15:42:25 · 376 阅读 · 0 评论 -
LeetCode513 找树左下角的值(BFS)
LeetCode513 找树左下角的值(BFS)BFS算法层层遍历,记录每层的最左边的结点的值# Definition for a binary tree node.class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = No...原创 2019-02-25 21:16:47 · 129 阅读 · 0 评论 -
Python实现二叉树(4种遍历,含层序遍历)
Python实现二叉树(4种遍历,含层序遍历)codeclass TreeNode(object): def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = rightclass Bi...原创 2019-02-25 20:39:37 · 1700 阅读 · 1 评论 -
LeetCode101. 对称二叉树 (递归) + (迭代)
LeetCode101. 对称二叉树 (递归) + (迭代)递归class Solution: def isSymmetric(self, root): """ :type root: TreeNode :rtype: bool """ if root: return sel...原创 2019-03-01 17:12:11 · 456 阅读 · 0 评论 -
LeetCode104 二叉树的最大深度(DFS)
LeetCode104 二叉树的最大深度(DFS)DFS递归# Definition for a binary tree node.class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = Noneclass Solutio...原创 2019-02-25 17:47:19 · 204 阅读 · 0 评论 -
Python 实现二叉搜索树(Binary Search Tree) and c++实现
Python 实现二叉搜索树(Binary Search Tree)and c++实现Pythonimport numpy as npclass Node(object): def __init__(self, data= None, lchild=None, rchild=None, parent=None): self.key = data ...原创 2019-02-17 22:25:10 · 601 阅读 · 0 评论 -
单向链表
单向链表相关函数代码整理笔记code#include<iostream>#include<cstdlib>using namespace std;typedef struct LNode{ int data; struct LNode *next;}LNode,*LinkList;void CreateLink(LinkLi...原创 2018-09-01 15:02:09 · 136 阅读 · 0 评论 -
LeetCode142. 环形链表 II(快慢指针)
快慢指针参考https://zhuanlan.zhihu.com/p/30990994?utm_source=qq&utm_medium=social&utm_oi=1080275092017270784# Definition for singly-linked list.class ListNode(object): def __init__(self, x):...原创 2019-03-06 23:45:18 · 181 阅读 · 0 评论