数据结构
文章平均质量分 61
鄜州与月
这个作者很懒,什么都没留下…
展开
-
数据结构基础 HW4 7-1 ZigZagging on a Tree
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standard routine to print the numbers in level-order. However原创 2022-10-18 23:57:07 · 1476 阅读 · 1 评论 -
【数据结构基础习题】Suppose that all the integer operands are stored in the stack S……
Suppose that all the integer operands are stored in the stack S原创 2022-10-07 23:20:29 · 766 阅读 · 0 评论 -
[数据结构基础习题0]Push 5 characters ooops onto a stack. In how many different ways that we can pop these...
Push 5 characters ooops onto a stack. In how many different ways that we can pop these characters and still obtain ooops?原创 2022-10-07 22:45:49 · 1322 阅读 · 0 评论 -
If a general tree T is converted into a binary tree BT, then which of the following BT...
If a general tree T is converted into a binary tree BT, then which of the following BT traversals gives the same sequence as that of the post-order traversal of T?答案:inorder traversal【解析】普通树(general tree)转化为二叉树(binary tree)具体可以看普通树转二叉树其实就是节点p的左儿子a还是左原创 2021-11-16 00:30:26 · 3283 阅读 · 0 评论 -
数据结构基础(关于heap的一些问题总结)ZJU-DS-HQM2021-WK6
知识点参考网站:https://www.cnblogs.com/embedded-linux/p/7302390.htmlheap概述堆(Heap)是计算机科学中一类特殊的数据结构的统称,堆通常是一个可以被看做一棵树的数组对象。1、堆是一棵完全二叉树;2、堆中的某个结点的值总是大于等于(最大堆)或小于等于(最小堆)其孩子结点的值。3、堆中每个结点的子树都是堆树。最大堆max-heap:每个节点的键值(key)都大于或等于其子节点键值最小堆min-heap:每个节点的键值(key)都小于或等于原创 2021-11-04 22:19:31 · 2952 阅读 · 0 评论 -
(数据结构基础)Among the following threaded binary trees (the threads are represented by dotted curves),……
当年学这些的时候真的是苦于没有人讲,现在复习考研,我会见到这种题就写下来,学弟学妹们欢迎点个关注,最近也在创业想实习的可以找我联系;没看懂的话是我表述有问题,欢迎指出和私戳。Among the following threaded binary trees (the threads are represented by dotted curves), which one is the postorder threaded tree?答案B(见下图)分析线索二叉树(threaded )的目的和使用方原创 2021-10-26 00:48:27 · 3876 阅读 · 0 评论 -
Given a binary search tree with its preorder traversal sequence { 8, 2, 15, 10, 12, 21 }.…
题目Given a binary search tree with its preorder traversal sequence { 8, 2, 15, 10, 12, 21 }. If 8 is deleted from the tree, which one of the following statements is FALSE? (3分)A. One possible preprder traversal sequence of the resulting tree may be { 2, 1原创 2021-10-25 17:39:07 · 1888 阅读 · 0 评论 -
Bonus-1 One Way In, Two Ways Out (20 分)
Bonus-1 One Way In, Two Ways Out (20 分)题干Consider a special queue which is a linear structure that allows insertions at one end, yet deletions at both ends. Your job is to check, for a given insertion sequence, if a deletion sequence is possible. For exa原创 2021-10-17 01:09:21 · 1188 阅读 · 1 评论 -
7-1 Pop Sequence (6 分)
7-1 Pop Sequence (6 分)题干Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5原创 2021-10-17 01:00:43 · 1361 阅读 · 0 评论 -
6-2 Reverse Linked List (10 分)
6-2 Reverse Linked List (10 分)Write a nonrecursive procedure to reverse a singly linked list in O(N) time using constant extra space.Format of functions:List Reverse( List L );where List is defined as the following:typedef struct Node *PtrToNode;typ原创 2021-09-30 10:51:15 · 1249 阅读 · 0 评论