The binary representation of +3997 is 1111 1001 1101.
In one's complement this is simply adding a sign bit and inverting all the bits:
1 0000 0110 0010
The two's complement is the one's complement plus 1:
1 0000 0110 0011
That's 13 bits. Normally the sign bit would be at an 8, 16 or 32,... bit boundary.
For -436 it's 10 0100 1100 and 10 bits
Answer:
The correct answer for the given question is " The Code fragment A runs fastly than the code fragment of B".
Explanation:
In this question there are some information is missing i. e options. The question does not give any options. The options for the given question is given below
(A.) The Code fragment A runs fastly than the code fragment of B.
(B.) The Code fragment B runs fastly than code fragment of A.
(C) The Code fragment A runs as fastly as code fragment of B.
So we conclude the answer i.e option(A) because As given in the question list1 is a MyArrayList and list2 is a MyLinkedList. , in list1 we fetching the data easily and fastly means that it remove the data easily as compare to list2 As MyArrayList is storing the list only and also we can fetch the data easily manner.
The list2 is an object of MyLinkedList means that it manipulating the data fastly as compared to MyArrayList but if we compared the fetching of data then MyArrayList is a better option so the code fragment runs fastly then code fragmented B.
You already wrote the answer. It is Additions
Answer:
6 2 and 0
Explanation:
This algorithm doesn't work if the list is not ordered ascending.
In this example it is not, and indeed the item "1" is never found.
first cycle: first=0, last=12 so midpoint=6
second cycle: first=0, last=5 so midpoint=2
last cycle: first=0, last=1 so midpoint=0
then last is assigned -1 so the while statement is no longer true.