leetcode
yuzhq2018
这个作者很懒,什么都没留下…
展开
-
leetcode反转链表
题目描述: 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 iteratively or recursi...原创 2018-12-24 23:48:50 · 66 阅读 · 0 评论 -
leetcode合并两个排序链表
题目描述: 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: Input: 1->2->4, 1->3->4 Output:...原创 2018-12-25 11:00:19 · 157 阅读 · 0 评论 -
leetcode删除链表倒数第N项
题目描述: 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->5, and n = 2. After removing the second node from the end,...原创 2018-12-25 17:58:59 · 92 阅读 · 0 评论 -
leetcode反转链表二
题目描述: Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: Input: 1->2->3->4->5->NULL, m = 2, n = 4 Output: 1->4->3->2->...原创 2019-01-06 11:04:47 · 105 阅读 · 0 评论 -
leetcode排序链表转成二叉搜索树
问题描述: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which...原创 2019-01-06 14:52:02 · 122 阅读 · 0 评论