代码改变世界

leetcode-0145 二叉树的后序遍历

2022-05-26 21:37 by jetwill, 13 阅读, 0 推荐, 收藏, 编辑
摘要:https://leetcode.cn/problems/binary-tree-postorder-traversal/ /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode 阅读全文

leetcode-0144 二叉树的前序遍历

2022-05-26 21:12 by jetwill, 15 阅读, 0 推荐, 收藏, 编辑
摘要:https://leetcode.cn/problems/binary-tree-preorder-traversal/submissions/ /** * Definition for a binary tree node. * public class TreeNode { * int val; 阅读全文

leetcode-0094 二叉树的中序遍历

2022-05-26 20:52 by jetwill, 12 阅读, 0 推荐, 收藏, 编辑
摘要:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { 阅读全文

implement-queue-using-stacks

2022-05-18 21:32 by jetwill, 19 阅读, 0 推荐, 收藏, 编辑
摘要:Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, pee 阅读全文

求解剑指Offer22 - 链表中倒数第K个节点

2022-05-18 21:01 by jetwill, 9 阅读, 0 推荐, 收藏, 编辑
摘要:ListNode 的定义 package com.company; public class ListNode { int val; ListNode next; ListNode() {} ListNode(int val) { this.val = val; } ListNode(int val 阅读全文

leetcode-0876 Middle Of The Linked List

2022-05-17 08:53 by jetwill, 5 阅读, 0 推荐, 收藏, 编辑
摘要:Given the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node. Examp 阅读全文

leetcode-0234 Palindrome Linked List

2022-05-16 21:49 by jetwill, 11 阅读, 0 推荐, 收藏, 编辑
摘要:Given the head of a singly linked list, return true if it is a palindrome. Example 1: Input: head = [1,2,2,1] Output: true Example 2: Input: head = [1 阅读全文

leetcode-0206 reverse-linked-list

2022-05-16 21:25 by jetwill, 14 阅读, 0 推荐, 收藏, 编辑
摘要:Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Examp 阅读全文

leetcoce-160 相交链表

2022-05-16 20:49 by jetwill, 13 阅读, 0 推荐, 收藏, 编辑
摘要:Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersec 阅读全文

leetcode-0142 linked-list-cycle-ii

2022-05-09 21:35 by jetwill, 11 阅读, 0 推荐, 收藏, 编辑
摘要:Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there 阅读全文
上一页 1 2 3 4 5 6 7 ··· 20 下一页