更多“如果按关键码值递增的顺序依次将n个关键码值插入到二叉搜索树中…”相关的问题
第1题
从空二叉树开始,严格按照二叉搜索树的插入算法(不进行旋转平衡),逐个插入关键码{18,73,10,5,68,99,27,41,51,32,25}构造出一棵二叉搜索树,对该二叉搜索树按照前序遍历得到的序列为?(答案中每两个元素之间用一个空格隔开) From a null binary tree, insert key values {18, 73, 10, 5, 68, 99, 27, 41, 51, 32, 25} successively according to the insertion algorithm of a binary search tree strictly (no rotation and balance) to construct a binary search tree. Please write down the sequence of preorder of this binary search tree. (There is one blank space between two elements)
点击查看答案
第2题
从空二叉树开始,严格按照二叉搜索树的插入算法(不进行旋转平衡),逐个插入关键码构造出一棵二叉树,以怎样的顺序插入关键码集合{14,32,47,6,9,12,78,63,29,81}可以使得树的深度最小? 请依次写出插入到树中的元素,每两个元素之间用一个空格隔开。 如果有多组满足要求的方案,请使得你的答案中先插入的元素尽可能的小。 From a null binary tree, insert key values successively according to the insertion algorithm of a binary search tree strictly (no rotation and balance) to construct a binary search tree. What is the insertion sequence that could make the tree have a smallest depth with a key value set {14,32,47,6,9,12,78,63,29,81}? Please write down the elements successively, and there is one blank space between two elements. If there are more than one answer that meet the condition, please make the element which needs to be inserted first as small as possible in your answer.
点击查看答案
第3题
从空二叉树开始,严格按照二叉搜索树的插入算法(不进行旋转平衡),逐个插入关键码{18,73,10,5,68,99,27,41,51,32,25}构造出一棵二叉搜索树,对该二叉搜索树按照后序遍历得到的序列为?(答案中每两个元素之间用一个空格隔开) From a null binary tree, insert key values {18, 73, 10, 5, 68, 99, 27, 41, 51, 32, 25} successively according to the insertion algorithm of a binary search tree strictly (no rotation and balance) to construct a binary search tree. Please write down the sequence of post order of this binary search tree. (There is one blank space between two elements)
点击查看答案
第4题
对于关键码序列{38,64,52,15,73,40,48,55,26,12},用筛选法建最小值堆,若一旦发现逆序对就进行交换,共需要交换元素多少次? For the key value sequence {38,64,52,15,73,40,48,55,26,12}, use the screening method to constuct a minimum heap, if we exchange them when we find reversed order, then how many times should we exchange them?
点击查看答案
第5题
对于给定的一组权W={1,4,9,16,25,36,49,64,81,100},构造一棵具有最小带权外部路径长度的三叉树,写出这棵树的带权外部路径长度。 For a given group of weights W={1, 4, 9, 16, 25, 36, 49, 64, 81, 100}, please construct a ternary tree with a minimum weighted route length and write down this weighted route length.
点击查看答案
第6题
对于如下图所示的最大堆,删除掉最大的元素后,堆的前序遍历结果是 For the following maximum heap, after deleting the maximum element, the preorder traversal sequence is 请依次写出插入到树中的元素,每两个元素之间用一个空格隔开。 Please write down the elements successively, and there is one blank space between two elements.
点击查看答案
第7题
下表展示了在一段文本中每个字母出现的次数。 The frequencies that each letter appears in a paragraph is represented as follow.对于这段文本使用Huffman编码相较使用等长编码能够节约多少比特的空间?Comparing to use codes that have the same length, how many bits of space could be saved when we use Huffman code for the paragraph?
点击查看答案
第8题
请阅读下面一段代码 Please read the following code C++:
Python:
若此段代码的作用是用来进行前序遍历,那么应该在几号访问点进行访问?(只需要填写数字) if this code is used to do a preorder traversal, which visiting point should be visited? (You only need to write down the number)
点击查看答案