摘要: atan2 反正切值 在 C++ 中,atan2 是一个数学函数,定义在头文件 <cmath> 中,用于计算 两个参数(y, x)所确定的角度的反正切值,也就是极坐标中的角度 θ(以弧度为单位): #include <cmath> #include <iostream> int main() { d 阅读全文
posted @ 2025-07-06 20:14 十八Eigh18n 阅读(28) 评论(0) 推荐(0)
摘要: C++ 二分搜索全解笔记 一、二分搜索基本原理 二分搜索(Binary Search)是一种在有序数组中查找目标值的算法,时间复杂度为 O(log n)。其核心思想是: 每次取中点,与目标值比较,缩小搜索区间。 基本流程: int binarySearch(const vector<int>& nu 阅读全文
posted @ 2025-07-06 19:36 十八Eigh18n 阅读(18) 评论(0) 推荐(0)