w****f 发帖数: 684 | 1 Looking glassdoor's microsoft questions, do not figure out the answers
for below questions.
Did some one know the answers?
Queue with circular array
What are skip lists?
using a mac function toLower(char c) to write a toUpper(char c) function
, without using any ascii code
What is a singleton? |
l*****a 发帖数: 14598 | 2 you still have a long way to go.
Bless
function
【在 w****f 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Looking glassdoor's microsoft questions, do not figure out the answers : for below questions. : Did some one know the answers? : Queue with circular array : What are skip lists? : using a mac function toLower(char c) to write a toUpper(char c) function : , without using any ascii code : What is a singleton?
|
w****f 发帖数: 684 | 3 Yes, but I am catching up...
I figured out skip list and singleton.
* Queue with circular array?
*using a mac function toLower(char c) to write a toUpper(char c)
function, without using any ascii code? |
x*******6 发帖数: 262 | 4 char toUpper(char c){
int i = 'a'-'A';
if(Character.isLetter(c)){
if(c-toLower(c)==0)
return (char)(c+i);
else
return c;
}else
throw new IllegalArgumentException();
}
circular array做queue是指queue的rear可以在front之前,两者和maxSize,size有公
式,自己去推导下。
|
x*******6 发帖数: 262 | 5 上面有行应该是 return (char)(c-i); -_-||| |
w****f 发帖数: 684 | 6 Thanks for response. I knew this solution, but question is without ASCII
code.
【在 x*******6 的大作中提到】![](/moin_static193/solenoid/img/up.png) : char toUpper(char c){ : int i = 'a'-'A'; : if(Character.isLetter(c)){ : if(c-toLower(c)==0) : return (char)(c+i); : else : return c; : }else : throw new IllegalArgumentException(); : }
|
x*******6 发帖数: 262 | |