P********i 发帖数: 172 | 1 这周有4个phone, 准备攒人品,汇报版面:
introduce yourself, previous projects,
the most recent project u are working on
1)what is the difference of "==", and "equalTo", why they are different?
when to use each?
2)what is the difference of "has-a", "is-a"
3)in java, final, finalize, finally
4)describe hash table, how to use
5)how to decide the highest bit of a byte?
6)given an un-sorted array with unsigned integer, how can u find out the
index of two numbers which sum up to 10? (write code, read code)
Note, return the index, which means could not destroy the original array.
7)given a root of a tree, after you write the tree to the disk, how can u
recover the tree? | h**********d 发帖数: 4313 | | g*********s 发帖数: 1782 | 3
so sorting is not allowed?
【在 P********i 的大作中提到】 : 这周有4个phone, 准备攒人品,汇报版面: : introduce yourself, previous projects, : the most recent project u are working on : 1)what is the difference of "==", and "equalTo", why they are different? : when to use each? : 2)what is the difference of "has-a", "is-a" : 3)in java, final, finalize, finally : 4)describe hash table, how to use : 5)how to decide the highest bit of a byte? : 6)given an un-sorted array with unsigned integer, how can u find out the
| c******t 发帖数: 391 | 4 Could you explain on the Q7? What the tree recover means?
Also, will they ask to explain the detailed implementation of Hash Table
such as random seed generation or something like that?
Thanks.
【在 P********i 的大作中提到】 : 这周有4个phone, 准备攒人品,汇报版面: : introduce yourself, previous projects, : the most recent project u are working on : 1)what is the difference of "==", and "equalTo", why they are different? : when to use each? : 2)what is the difference of "has-a", "is-a" : 3)in java, final, finalize, finally : 4)describe hash table, how to use : 5)how to decide the highest bit of a byte? : 6)given an un-sorted array with unsigned integer, how can u find out the
| P********i 发帖数: 172 | 5 sure, since tree are pointers, when u save the tree to disk, you need to
record the parent-child relationship in a way which can help u to recover,
when read data from disk back to memory.
There could be several solutions here, the reviewer asked me to provide as
many solutions as possible:
1) preorder + inorder -> reconstruct tree
Note instead of storing the whole tree node, you can just save an ID for
each node, and mapping ID to real node when necessarily.
2) use dewey index
since my research is in database, hence I am somehow familiar with dewey
index solution here, you can check wiki for more information.
e.g. 0 (root)
0.1 0.2
0.1.1 0.1.2 0.2.1 0.2.2
... ... ....
3) check tree to linked list
save linked list information
There are the solutions I proposed, maybe some others, call for new proposal
:)
【在 c******t 的大作中提到】 : Could you explain on the Q7? What the tree recover means? : Also, will they ask to explain the detailed implementation of Hash Table : such as random seed generation or something like that? : Thanks.
| P********i 发帖数: 172 | 6 No sorting allowed, since it may destroy the original index of the array.
Just go ahead with the O(n^2) solution, naive way, as the feedback from the
reviewer, although I proposed 3 solutions
1) sort, search
2) hashtable
3) naive: two for loops
【在 g*********s 的大作中提到】 : : so sorting is not allowed?
| f*********5 发帖数: 576 | 7 why not use hashtable?
array.
the
【在 P********i 的大作中提到】 : No sorting allowed, since it may destroy the original index of the array. : Just go ahead with the O(n^2) solution, naive way, as the feedback from the : reviewer, although I proposed 3 solutions : 1) sort, search : 2) hashtable : 3) naive: two for loops
| m****i 发帖数: 650 | 8 what does this mean
5)how to decide the highest bit of a byte?
How to use linked list to recover the tree?
3) check tree to linked list
save linked list information | c******t 发帖数: 391 | 9 5) maybe is to check if the highest bit is 0 or 1, how about this?
temp=num;
return (temp>>7)&1
for 3) co-ask...
【在 m****i 的大作中提到】 : what does this mean : 5)how to decide the highest bit of a byte? : How to use linked list to recover the tree? : 3) check tree to linked list : save linked list information
| P********i 发帖数: 172 | 10 bingo:)
(1<<7) & temp;
【在 c******t 的大作中提到】 : 5) maybe is to check if the highest bit is 0 or 1, how about this? : temp=num; : return (temp>>7)&1 : for 3) co-ask...
| s*******3 发帖数: 134 | |
|