kunal.karoth
BAN USER
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Simply AND the X with 255. if it gives a zero it means its 1 byte. If not AND it with double of 255 ie (2^16-1) and so on...
the place where u get a zero is the size of the variable or data type.
Comment hidden because of low score. Click to expand.
0
of 0 vote
The solution is simple, to decide if it is a japanese char or an Ascii we first go left till we find the last of the prev byte. Now, we scan for the no of 1's between the end of prev and cursor.
If the no of 1's is even ------->ASCII so delete 1 byte.
Else...no of 0's is odd--------->Japanese char so delete 2 bytes.
Comment hidden because of low score. Click to expand.
0
of 0 vote
simply check the first, any intermediate and then the last element of the circular list. Accordingly insert.
Just make sure that before insertion, you check if you are inserting in the correct position
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Add the elements of the first array in a binary tree. Now for every element in array 2, we try to insert in binary tree. In our binary tree we check the condition if the value already exists we, simply delete the node from the binary tree.
- kunal.karoth March 03, 2010Thus, if the 2 arrays have the same elements then, at the end of the process the binary tree would be empty