Answer:
Explanation:
The following code is written in Java it goes through the queue that was passed as an argument, loops through it and removes all the odd numbers, leaving only the even numbers in the queue. It does not add any more data structures and finally returns the modified queue when its done.
public static Queue<Integer> evens(Queue<Integer> queue) {
int size = queue.size();
for(int x = 1; x < size+1; x++) {
if ((queue.peek() % 2) == 0) {
queue.add(queue.peek());
queue.remove();
} else queue.remove();
}
return queue;
}
Answer:
10
Explanation:
Pointer arithmetic is tricky. The address is incremented by the sizeof the pointed element. A short is 2 bytes.
So adding 10 adds 20 bytes to the starting address of arr[].
In the expression, you're adding 10-6 = 4 to the start of the array, so you're pointing at the fifth element, arr[4] which is 10.
Answer:
Byte Short Int Long
Explanation:
Byte's 8 bit, short's 16, int's 32, and long's 65.
HDDs usually wear down faster and give less performance quality than SSD but HDDs are still cheaper. If your aiming for budget , HDD is the right one for you.
a hard drive is a metal disk constantly spinning while powered on.
The data is written with a metal scratching the data onto the wheel.