Convert the binary number 101110₂ to octal.
Group into 3 bits (from right):
101 110
101₂ = 5
110₂ = 6
Answer: 56₈
Compute the binary addition:
1011₂ + 0110₂
Answer: 10001₂
(Rules: 1+1 = 10₂ → 0 with carry 1 into the next bit.)
Convert the 8‑bit two’s complement binary number 1111 0111₂ to decimal.
Two’s complement negative → flip bits + 1 → 0000 1001₂ = 9 →−9 in decimal.
Define what a queue data structure is and explain its main property.
A queue is an abstract data structure that follows First‑In‑First‑Out (FIFO): elements are added at the rear and removed from the front.
What is a binary tree?
A data structure in which each node can have at most two children, called left and right.
Convert the octal number 745₈ to binary
Convert each octal digit to 3-bit binary:
7 = 111
4 = 100
5 = 101
Answer: 111100101₂
Perform this binary addition with carry:
11001₂ + 10111₂
Answer: 110000₂
Find the 8‑bit two’s complement binary representation of −13 decimal
+13 = 0000 1101₂ → flip bits → 1111 0010₂ → add 1 → 1111 0011₂.
Define what a stack data structure is and explain its main property.
A stack is an abstract data structure that follows Last‑In‑First‑Out (LIFO): elements are pushed onto the top and popped from the top.
What is a leaf node?
A node that has no children.
Convert the hexadecimal number 3A₁₆ to octal
→ 00111010₂
000 = 0
111 = 7
010 = 2
Answer: 72₈
Multiply these binary numbers:
101₂ × 111₂
Answer: 100011₂
What is the range of values that can be represented with 8‑bit two’s complement?
From −128 to +127
List three basic operations for a queue and briefly describe what each does
enqueue(x) – add element x to the rear of the queue
dequeue() – remove and return the element from the front
isEmpty() – check whether the queue has no elements.
What is the root node?
The topmost node of the tree from which all other nodes originate
Convert the octal number 527₈ to decimal and determine the minimum number of bits required to store it.
5×8² + 2×8¹ + 7×8⁰
= 5×64 + 16 + 7
= 320 + 16 + 7
= 343₁₀
2⁸ = 256 (not enough)
2⁹ = 512 (enough)
Compute the binary addition:
11101₂ + 11011₂
Then express the result in decimal
Binary sum
→ 111000₂
Decimal form:
111000₂ = 56₁₀
Add the following two 8‑bit signed two’s complement numbers and give the result in decimal:
0001 0010₂ (decimal +18) + 1110 1011₂ (decimal −21)
Binary sum = 1111 1101₂ → two’s complement negative conversion → +3 →
Result: −3.
List three basic operations for a stack and briefly describe what each does
push(x) – add x to the top of the stack
pop() – remove and return the item at the top
peek() – return the top element without removing it.
What is the Binary Search Tree (BST) property?
The rule stating that values smaller than a node go to the left subtree, and larger values go to the right subtree.
Convert the binary number 110101111001₂ to both octal and hexadecimal
Octal: 6571₈
Hexadecimal: D79₁₆
Multiply the following binary numbers and then convert the result to decimal:
1101₂ × 1011₂
10011111₂ (decimal 159)
Represent −7 decimal in 4‑bit two’s complement
Interpret the 4‑bit two’s complement binary 1001₂ in decimal
+7 = 0111₂ → flip → 1000₂ → +1 → 1001₂ = −7
1001₂ = −7 decimal
Surprise
You куһһreceived 500 point
What does “-1” represent in the array-based BST implementation?
In an array representation of a Binary Search Tree, this value indicates that a node does not have a left or right child