Question: c++ question on binary tree/templates: go here - https://github.com/connectp/cplusplus Consider the following code with its corresponding output: int x = 2; int y = 5;
c++ question on binary tree/templates: go here - https://github.com/connectp/cplusplus
Consider the following code with its corresponding output:
int x = 2; int y = 5; Node node1(&x,2); Node node2(&y,5); std::cout << node1 << std::endl; std::cout << node2 << std::endl;
OUTPUT:
0x7fff5cded970: 2 0x7fff5cded96c: 5
If in your code on your machine if you had the above node1 and node2 declarations and applied the logical operator:
node1 > node2
what will be the result and why?
Select one:
a. False. 2 is not greater than 5.
b. True, since the key value of node 1 is greater.
c. Compilation error.
d. Unknown, because it depends on where in memory the two are stored
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
