1, WINDOWS32-bit machine and 64-bit machine sizeof (int), sizeof (int *), sizeof (void *), sizeof (long), sizeof (long long) what is the number of each?
2. Can virtual functions in C + + be private? Why?
3. Where are static data members in the C + + class initialized?
4. Can the parameters of virtual functions in C + + class be template parameters?
5. What is the state of memory when the program is running?
6, binary sorting tree, how to find the current node of the successor node?
7. Find out if the array of unordered positive integers has two numbers and is the given integer target?
8, multi-process and multi-threaded differences and contact?
9, put a stone directly into the deep enough water, and put a stone on the boat floating on the water, which situation is higher water level?
7. Find out if there are two numbers in the array of unordered positive integers and a given integer Target?class solution {public: vector<int> twosum (vector<int> & numbers, int target) { vector<int> res; Map<int,int> Numbersmap; Map<int,int>::iterator iter; for (int i=0;i<numbers.size (); i++) { iter=numbersmap.find (target-numbers[i]); if (Iter!=numbersmap.end ()) { res.push_back (iter->second); Res.push_back (i+1); break; } else { numbersmap[numbers[i]]=i+1; } } return res; }};
Xiaomi interview Record