摘要:
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
摘要:
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题意:给定一个有序的链表,将其转换成平衡二叉搜索树思路: 二分法要构建一个平衡二叉... 阅读全文
摘要:
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
摘要:
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题意:对k个有序的链表进行归并排序。并分析其复杂度。/** * Definition for singly-... 阅读全文
摘要:
Sort a linked list using insertion sort.题目要求:链表的插入排序,由于没有时间复杂度的要求,可以直接循环操作。/** * Definition for singly-linked list. * struct ListNode { * int val;... 阅读全文
摘要:
在上一节中,我们讲述了如何在路由器上挂载U盘,以及如何通过改造U盘提升路由器的存储和数据处理能力。通过增加USB挂载,为我们后续进行智能家居构建提供了保障。
在本节中,我将简单介绍如何在路由器上建立网络文件共享服务。 阅读全文
摘要:
There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requi... 阅读全文