摘要: 977 有序数组的平方 冒泡排序 暴力冒泡排序实现 class Solution { public: vector<int> sortedSquares(vector<int>& nums) { int size = nums.size(); int tmp; for (int i = 0; i < 阅读全文
posted @ 2024-02-26 23:00 operin 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 704 二分查找 数组基础 数组空间地址连续、随机访问时间复杂度O(1)、删除和移动时间复杂度O(n) vector和array区别:vector底层实现为array;array是栈上开辟空间、vector是堆上开辟空间;array不支持迭代器访问,支持指针和索引、vector还支持迭代器访问 二分 阅读全文
posted @ 2024-02-22 08:09 operin 阅读(13) 评论(0) 推荐(0) 编辑