摘要: 题目: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of 阅读全文
posted @ 2020-08-05 04:51 IreneZh 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Example 1: Input: root = [3,1,4,null,2], k = 1 3 阅读全文
posted @ 2020-08-05 03:36 IreneZh 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 题目:Trim a Binary Search Tree Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies 阅读全文
posted @ 2020-08-05 00:20 IreneZh 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 分割链表 题目: Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The lengt 阅读全文
posted @ 2020-06-10 06:52 IreneZh 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 判断回文链表 Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->1 Output: true Fol 阅读全文
posted @ 2020-06-09 04:20 IreneZh 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 链表求和。 要求:不修改原始链表。 题目: LeetCode455 You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes fi 阅读全文
posted @ 2020-05-30 05:22 IreneZh 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 删除链表中倒数第n个结点 题目:LeetCode19 Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4- 阅读全文
posted @ 2020-05-29 06:06 IreneZh 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 删除链表中的重复结点: Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 阅读全文
posted @ 2020-05-26 07:17 IreneZh 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
posted @ 2020-05-26 05:41 IreneZh 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iterativ 阅读全文
posted @ 2020-05-25 12:18 IreneZh 阅读(110) 评论(0) 推荐(0) 编辑