answer: Hash table is a data structure to implemented associated array, a structure that can map keys to values. A hash table uses a hash function to compute a index into an array of buckets or slots, from which the correct value could be found.
hashtable一般会问open addressing的实现
注意一下rehash就好了
链表hash不是纯没技术含量么。。。
而且一般正经的库里也不用链表的实现
answer: They are completely different type of concepts. A reference is an alias of a object. A pointer is an object contains address pointed to another object.
3. explain the various uses of keyword "static" in c++?
answer: In C++, there are 3 different use of keyword static: local static objects, static class data members and static class member functions.
A local static objects is a local objects whose value persist across calls to the function. It is initialized before the first time execution pass through the object's definition. The local static objects are not destroyed when function call ends. They are destroyed when program ends.
Static data members of a class exist outside any objects of its class type. They are not initialized by class' constructors. More over, we must initialize each static data member outside the class body(except const static data member). Once they are defined, they exist until program ends.
Static member functions are also not bound to any objects. They cannot access non-static data members of the class. They do not have "this" pointer, as a result, may not be declared as const. Both static data members and static member function can be accessed by a scope operator "::".
4. 一个空的class 的大小?
answer: 1 byte.
5. 有没有virtual constructor?
answer: no.
6. heap sort
No comments:
Post a Comment