(a) How many bits are in a Java byte? (b) How many bytes are in a Java short? ©
ID: 3916816 • Letter: #
Question
(a) How many bits are in a Java byte?
(b) How many bytes are in a Java short?
© How many bytes are in a Java int?
(d) How many bytes are in a Java float?
(e) How many bytes are in a Java double?
(f) How many bytes are in a Java long?
2. Recall that in a binary tree, a node may have 0, 1, or 2 children. In the following questions about binary trees, the height of a tree is the length (number of edges) of the longest path. A tree consisting of just one node has height 0.
a.) What is the maximum number of nodes in a binary tree of height d?
b.) What is the minimum number of nodes in a binary tree of height d?
c.) What is the maximum height of a binary tree containing n nodes?
d.) What is the minimum height of a binary tree containing n nodes?
Explanation / Answer
(a) How many bits are in a Java byte?
:- 8 bits
(b) How many bytes are in a Java short?
:-2 bytes
© How many bytes are in a Java int?
:-4 bytes
(d) How many bytes are in a Java float?
:-4 bytes
(e) How many bytes are in a Java double?
:-8 bytes
(f) How many bytes are in a Java long?
:-8 bytes
Question 2:-
a.) What is the maximum number of nodes in a binary tree of height d?
:-2d+1?1
b.) What is the minimum number of nodes in a binary tree of height d?
:-d+1
c.) What is the maximum height of a binary tree containing n nodes?
:-n-1
d.) What is the minimum height of a binary tree containing n nodes?
:-floor(log2(n))
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.