Answer:
Explanation:
#include <stdio.h>
int main(void)
{
int num, rem;
printf("Enter a number: ");
scanf("%d", &num);
printf("Roman numerals: ");
while(num != 0)
{
if (num >= 1000) // 1000 - m
{
printf("m");
num -= 1000;
}
else if (num >= 900) // 900 - cm
{
printf("cm");
num -= 900;
}
else if (num >= 500) // 500 - d
{
printf("d");
num -= 500;
}
else if (num >= 400) // 400 - cd
{
printf("cd");
num -= 400;
}
else if (num >= 100) // 100 - c
{
printf("c");
num -= 100;
}
else if (num >= 90) // 90 - xc
{
printf("xc");
num -= 90;
}
else if (num >= 50) // 50 - l
{
printf("l");
num -= 50;
}
else if (num >= 40) // 40 - xl
{
printf("xl");
num -= 40;
}
else if (num >= 10) // 10 - x
{
printf("x");
num -= 10;
}
else if (num >= 9) // 9 - ix
{
printf("ix");
num -= 9;
}
else if (num >= 5) // 5 - v
{
printf("v");
num -= 5;
}
else if (num >= 4) // 4 - iv
{
printf("iv");
num -= 4;
}
else if (num >= 1) // 1 - i
{
printf("i");
num -= 1;
}
}
return 0;
}
Answer: B
Explanation:
if each color can be represented as 8 bits and you have 3 colors total that would mean you would need 24 bits to represent the entirety of the RGB spectrum. And each bit can either be on or off so you have two choices for each one. So the total amount of colors you can have for 8bit RGB would be which is 16,777,216.
2 Consider the sequence of keys (5,16,22,45,2,10,18,30,50,12,1). Draw the result of inserting entries with these keys (in the gi
Juliette [100K]
Answer:
A) (2,4) tree
- Insertion of key 45 makes key unbalanced and this is because it violates the 2,4 tree so we split the node
- insertion of key 10 makes key unbalanced and this is because it violates the 2,4 tree so we split the node
B) Red-black tree
Explanation:
The diagrams for the solutions are attached showing the results of inserting entries