看啥推荐读物
专栏名称: 程序IT圈
一个学习编程技术和读者福利共存的公众号,每天推送高质量的优秀博文和原创文章,开源项目,实用工具,面试技巧等 。公众号每月至少一次读者送书福利! 关注置顶,不错过精彩推送!
今天看啥  ›  专栏  ›  程序IT圈

​LeetCode刷题实战109:有序链表转换二叉搜索树

程序IT圈  · 公众号  · 程序员  · 2020-11-28 13:30
算法的重要性,我就不多说了吧,想去大厂,就必须要经过基础知识和业务逻辑面试+算法面试。所以,为了提高大家的算法能力,这个公众号后续每天带大家做一道算法题,题目就从LeetCode上面选 !今天和大家聊的问题叫做 有序链表转换二叉搜索树,我们先来看题面:https://leetcode-cn.com/problems/convert-sorted-list-to-binary-search-tree/Given the head of 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 the depth of the two subtrees of every node never differ by more than 1.题意给定一个单链表,其中的元素按升序排序,将其转换为高度平衡的二叉搜索树。本题中,一个高度平衡二叉树是指一个二叉树每个节点 ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照