Synology可以加密硬盘吗?# Hardware - 计算机硬件
p*e
1 楼
1. print a linked list reversely.
I write 3 methods,
1. recursive
2. use a temporary vector to save list nodes
3. reverse the linked list first, and then print (we could reverse it back
if required)
Then I was asked in which situation method 2 is better than 3. (the answer
he want is multi-thread, I didn't get it :( )
2. Suppose we have a following struct:
struct Bits{ unsigned known, unsigned value};
if a certain bit in known is set, it means the value of this bit is known,
and its corresponding value is saved in Bits->value.
for example, if known = 0011, value = 0001, that means Bits has last 2 bits
value known, one is 0 and the other is 1.
implement the following method to calculate the or of 2 Bits:
void or(Bits* out, const Bits& in1, const Bits& in2);
BTW, still didn't got hr's feedback yet....
I write 3 methods,
1. recursive
2. use a temporary vector to save list nodes
3. reverse the linked list first, and then print (we could reverse it back
if required)
Then I was asked in which situation method 2 is better than 3. (the answer
he want is multi-thread, I didn't get it :( )
2. Suppose we have a following struct:
struct Bits{ unsigned known, unsigned value};
if a certain bit in known is set, it means the value of this bit is known,
and its corresponding value is saved in Bits->value.
for example, if known = 0011, value = 0001, that means Bits has last 2 bits
value known, one is 0 and the other is 1.
implement the following method to calculate the or of 2 Bits:
void or(Bits* out, const Bits& in1, const Bits& in2);
BTW, still didn't got hr's feedback yet....