随笔分类 -  C++学习随笔

记录一些c++知识
摘要:介绍 红黑树是一种特殊的平衡二叉树(AVL),可以保证在最坏的情况下,基本动态集合操作的时间复杂度为O(logn)。因此,被广泛应用于企业级的开发中。 红黑树的性质 在一棵红黑树中,其每个结点上增加了一个存储位(属性color)来表示结点的颜色,且颜色只能是red or black。通过对任何一条从 阅读全文
posted @ 2019-10-19 01:12 守功 阅读(2698) 评论(0) 推荐(0)
摘要:As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some ro 阅读全文
posted @ 2018-09-07 00:02 守功 阅读(240) 评论(0) 推荐(0)
摘要:Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making 阅读全文
posted @ 2018-09-06 01:42 守功 阅读(133) 评论(0) 推荐(0)
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2018-09-05 19:18 守功 阅读(308) 评论(0) 推荐(0)
摘要:二叉查找树(BST) 特殊的二叉树,又称为排序二叉树、二叉搜索树、二叉排序树。 二叉查找树实际上是数据域有序的二叉树,即对树上的每个结点,都满足其左子树上所有结点的数据域均小于或等于根结点的数据域,右子树上所有结点的数据域均大于根结点的数据域。如下图所示: 二叉查找树通常包含查找、插入、建树和删除操 阅读全文
posted @ 2018-08-09 16:46 守功 阅读(15454) 评论(7) 推荐(0)
摘要:问题描述 Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national 阅读全文
posted @ 2018-08-05 00:10 守功 阅读(217) 评论(0) 推荐(0)
摘要:前缀表达式(波兰表达式)、中缀表达式、后缀表达式(逆波兰表达式) 介绍 三种表达式都是四则运算的表达方式,用以四则运算表达式求值,即数学表达式的求解。 前缀表达式 前缀表达式是一种没有括号的算术表达式,与中缀表达式不同的是,其将运算符写在前面,操作数写在后面。为纪念其发明者波兰数学家Jan Luka 阅读全文
posted @ 2018-08-03 11:24 守功 阅读(5752) 评论(0) 推荐(1)
摘要:2018-08-02 1. lower_bound()和upper_bound()用法记录 lower_bound()和upper_bound()需要用在一个有序(敲敲小桌板)数组或容器中。 lower_bound(first, last, val)用来寻找在数组或容器的[first,last)范围 阅读全文
posted @ 2018-08-02 15:43 守功 阅读(142) 评论(0) 推荐(0)