![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
云野云野云野
不管要去哪里,不能因为不知道,就在地上躺着。
展开
-
leetcode160_相交链表
给你两个单链表的头节点 headA 和 headB ,请你找出并返回两个单链表相交的起始节点。如果两个链表没有交点,返回 null 。/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } *原创 2021-09-08 11:29:45 · 70 阅读 · 1 评论 -
leetcode144,145_二叉树的前序,后序,中序遍历
二叉树的前序遍历是先根节点,然后左节点,最后右节点,递归遍历时,递归终止条件是当前节点为空,当前节点不为空时,先把当前节点的值存入到list中,然后先去遍历左子树,再遍历右子树。/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeN原创 2021-09-08 10:19:49 · 63 阅读 · 0 评论