direct and indirect assignments
#include <stdio.h>
int main(void) {
int n, // n is a variable of type int
*pn; // pn is a variable of type ptr to int
n = 13;
printf("direct assignment of variable n: execute n = 13;\n");
printf("the value of n is %d\n\n", n); // yields 23
pn = &n;
*pn = 26;
printf("let pn be the address of n\n");
printf("indirect assignment of variable n: execute *pn = 26;\n");
printf("and then print the value of n again:\n");
printf("the value of n is %d\n\n", n); // yields 26
return(0);
}
|
|
OUTPUT:
|
Implementation of binary search tree
|
|
OUTPUT:
|
Implementation of binary search tree
• the tree has no header
• the implementation consists of a combination of iterative and recursive functions.
• an iterative implementation is used for insert, delete, get and set, since in
these functions either lhs or rhs is important, but not both!
• a recursive implementation is used if both lhs and rhs play a role such as in
the functions size, print, process, ...
|
|
OUTPUT:
|