随笔分类 -  算法与数据结构

摘要:题目 A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic num 阅读全文
posted @ 2020-05-16 14:07 无代码,非程序 阅读(158) 评论(0) 推荐(0)
摘要:题目 Notice that the number 123456789 is a 9 digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2469 阅读全文
posted @ 2020-05-16 10:45 无代码,非程序 阅读(155) 评论(0) 推荐(0)
摘要:题目 A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published ye 阅读全文
posted @ 2020-05-15 00:38 无代码,非程序 阅读(139) 评论(0) 推荐(0)
摘要:题目 It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward tha 阅读全文
posted @ 2020-05-14 19:19 无代码,非程序 阅读(105) 评论(0) 推荐(0)
摘要:题目 A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find 阅读全文
posted @ 2020-05-14 18:48 无代码,非程序 阅读(528) 评论(0) 推荐(0)
摘要:题目 Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to 阅读全文
posted @ 2020-05-14 13:30 无代码,非程序 阅读(182) 评论(0) 推荐(0)
摘要:题目 A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic num 阅读全文
posted @ 2020-05-13 22:48 无代码,非程序 阅读(102) 评论(0) 推荐(0)
摘要:题目 There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at an 阅读全文
posted @ 2020-05-12 20:14 无代码,非程序 阅读(253) 评论(0) 推荐(0)
摘要:题目 Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All th 阅读全文
posted @ 2020-05-12 12:56 无代码,非程序 阅读(177) 评论(0) 推荐(0)
摘要:题目 Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The ru 阅读全文
posted @ 2020-05-11 09:18 无代码,非程序 阅读(1249) 评论(0) 推荐(1)
摘要:一、基本概念 二叉搜索树 (又叫二叉查找树、二叉排序树),具有以下特点: 1. 节点的左孩子的值小于节点本身; 2. 节点的右孩子的值大于节点本身; 3. 左右子树同样为二叉搜索树; 所以最终效果是: 节点左子树的所有节点的值都小于节点本身; 节点右子树的所有节点的值都大于节点本身; 对二叉搜素树的 阅读全文
posted @ 2020-04-26 11:45 无代码,非程序 阅读(426) 评论(0) 推荐(0)
摘要:一、回顾 在 "上一篇博客" 中,我们已经分析出了插入一个节点之后,红黑树需要如何进行调整对应的三种情形: 首先:新插入红黑树的节点一定是红色 1. 若新插入节点的爸爸是黑色节点,红黑树不需要调整 2. 若新插入节点的爸爸和它叔叔都是红色节点,红黑树只需要变色,不需要旋转 3. 若新插入节点的爸爸是 阅读全文
posted @ 2020-04-26 11:44 无代码,非程序 阅读(615) 评论(0) 推荐(0)