摘要:
题目: //方法一,利用优先队列小顶堆greater(大顶堆是less) class Solution { public: int findKthLargest(vector<int>& nums, int k) { priority_queue<int, vector<int>, greater<
阅读全文
posted @ 2024-03-10 21:25
孜孜不倦fly
阅读(8)
推荐(0)
编辑
摘要:
题目: //方法一,空间复杂度O(n) class Solution { public: bool isPalindrome(ListNode* head) { vector<int> nums; //放进数组后用双指针判断 ListNode* cur = head; while(cur){ num
阅读全文
posted @ 2024-03-10 21:02
孜孜不倦fly
阅读(5)
推荐(0)
编辑