堆排序 : 什么是堆排序?
顺序表与链表的优缺点:博客
红黑树与AVL树,各自的优缺点总结:博客
topk问题 博客
插入排序及其优化:
快速排序及其优化:
两数之和:
冒泡排序时间复杂度多少?是否是稳定排序?
快速排序的时间复杂度最好最坏分别是多少?
平衡二叉搜索树的数据结构是怎样?
给一个320G装满QQ号码的文件(不能加载进内存),如何判断某数字在不在其中。 (面试官提示 用外排序)
数组中只有一个元素出现一次,其他元素出现三次的做法。
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int one=0;
int two=0;
int three=0;
vector<int> a;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int kk;
cin>>kk;
a.push_back(kk);
}
for(int i=0;i<n;i++)
{
two |=one & a[i];
one ^=a[i];
three= two&one;
one &= ~three;
two &= ~three;
}
cout<<one<<endl;
}