
笔记
初学者清水
这个作者很懒,什么都没留下…
展开
-
lower_bound与upper_bound
@lower_bound与upper_bound lower_bound( )和upper_bound( )都是利用二分查找的方法在一个排好序的数组中进行查找的。 在从小到大的排序数组中, lower_bound( begin,end,num):从数组的begin位置到end-1位置二分查找第一个大于或等于num的数字,找到返回该数字的地址,不存在则返回end。通过返回的地址减去起始地址begin,得到找到数字在数组中的下标。 upper_bound( begin,end,num):从数组的begin位置到原创 2022-02-20 16:02:56 · 8462 阅读 · 0 评论 -
2021.10笔记
一、10.11 1.先序+中序遍历算后序遍历以及中序+后续遍历算先序遍历程序。 2.PTA03-树3 Tree Traversals Again,其中出错 原因:s1是字符串,ELement是int型。应该改成下图这个样子,不能直接push。 ...原创 2021-10-11 19:12:08 · 126 阅读 · 0 评论