unixxxxxx
unixxxxxx
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
unixxxxxx的博客
全部文章
(共9篇)
题解 | #删除链表的倒数第n个节点#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2024-01-19
0
283
题解 | #链表中环的入口结点#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; */ #include <ios> class...
2024-01-11
0
363
题解 | #判断链表中是否有环#
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
2024-01-11
0
355
题解 | #合并k个已排序的链表#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <vector> class S...
2024-01-11
0
329
题解 | #寻找第K大#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param a int整型一维数组 # @param n int整型 # @param K int整型 # @return int整型 # class Solution: def find...
2023-03-12
0
0
题解 | #二叉搜索树的最近公共祖先#
Python 简单递归 # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # 代码中的类名、方法...
Python3
2022-03-24
1
0
题解 | #判断是不是平衡二叉树#
很不优美的 python 代码 # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # 代码中的类...
Python3
2022-03-24
0
421
题解 | #判断是不是完全二叉树#
写的很长很臭的 BFS # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # 代码中的类名、方法...
Python3
2022-03-24
0
413
题解 | #判断是不是二叉搜索树#
为什么没有 python 版本?? # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # 代码中...
Python3
2022-03-24
2
513