Change slides by clicking on background.
Answer:
10
Explanation:
An enqueue operation is a function that adds an element(value) to a queue array. A dequeue operations removes an element from a queue array. Queue arrays follow a first-in-first-out approach, so elements that are first stored in the queue are removed/accessed first(enqueue operations add elements at the rear of the queue array).
The following operations leave 10 elements in the queue of array size 12 after its done:
10 enqueue operations= adds 10 elements
5 dequeue operations= removes 5 elements( 5 elements left in queue)
6 enqueue operations= adds 6 elements(11 elements in queue)
10 dequeue operations= removes 10 elements(1 element left in queue)
8 enqueue operations= adds 8 elements(9 elements in queue)
2 dequeue operations= removes 2 elements(7 elements left in queue)
3 enqueue operations= adds 3 elements(10 elements in queue)
Therefore there are 10 elements in the queue after enqueue and dequeue operations.
Answer:
Translate ➡️ allows the user to change words from one language to another
Smart Lookup➡️allows user to find the definition of a word or a phrase.
Thesaurus ➡️ allows the user to find the synonyms and antonyms of a word.
Explanation:
I have been able to match each took to the tasks that they perform.
In Translate, users can easily change words into a different language. That means that words in English can be translated into French, Spanish, etc., and vice versa.
In Smart Lookup, users can actually find definitions of words or phrases. Smart Lookup can be found in Microsoft Word Office.
The Thesaurus is used to find the synonyms and antonyms of words.
These tools make learning very easy and enjoyable.
Answer:
The process of adding binary numbers is the same as the process adding decimal numbers which are the normal base 10 numbers with the difference being that in decimal numbers there are digits 1 to 9 and in binary numbers, there are only digits 1 and 0
So when we add binary numbers, we havr;
0 + 0 = 0
1 + 0 = 1
0 + 1 = 1
1 + 1 = 10
Why 1 + 1 = 10 is because, there are no 2s in binary number system, just like when we get from 0 to 9 in a decimal system we start again at 10
For binary subtraction, we have the following;
0 - 0 = 0
1 - 0 = 1
1 - 1 = 0
10 - 1 = 1 (from 1 + 1 = 10)
For example 1100₂ - 1010₂ = 0010₂
As shown below
Borrow 1
, ↓
1, 1 ¹0 0
<u> 1, 0 1 0</u>
, 0 0 1 0
The addition and subtraction of the binary number system are similar to that of the decimal number system. The only difference is that the decimal number system consists the digit from 0-9 and their base is 10 whereas the binary number system consists only two digits (0 and 1) which make their operation easier
Explanation:
Answer:
C++ Code:
void sort3(double &a, double &b, double &c)
{
if(a > b)
swapdoubles(a,b);
if (b > c)
swapdoubles(b,c);
if (a > b)
swapdoubles(a,b);
}
Explanation:
To change the values of a,b,c within the function, we pass the values by reference. Let us assume that number a = 3.14, b = 2.71, c = 3.04. Since a > b, values of a and b will be swapped.Now a = 2.71 and b = 3.14. Similariy, since b > c, they will be swapped. This way, we move the largest number to its correct position in the first two steps. If there are only three numbers, and the largest number is in its correct position, then for the two remaining numbers, we will only need atmost one swap to exchange their positions. hence, we perform a comparison of a > b once again to see if the b is smaller than a. if its not, then all a,b,c are in sorted order.