Question
Q1 ) Draw and show preorder traversal of the binary search tree with using the given traversals. In order Traversal : 0 1 4 5
Q1 ) Draw and show preorder traversal of the binary search tree with using the given traversals.
Inorder Traversal :
0 1 4 5 6 8 9 10 12 15 17 18 20 28 35 45 88 99
Postorder Traversal:
0 6 5 4 1 9 8 15 18 17 35 88 99 45 28 20 12 10
Q2 ) File TEST.DAT contains only the FOLLOWING CHARACTERS:
I | T | E | C | 2 | 1 | 3 |
| D | A | T | A |
| S | T | R | U | C | T | U | R | E | EOF |
Show the letter of the alphabet that the ch indicates after executing the given instructions.
FILE *fp;
char ch;
fp = fopen(TEST.DAT,rb+);
fseek(fp,-2,SEEK_END);
ch = getc(fp); printf( \t %c,ch);
fseek(fp,-5, SEEK_CUR);
ch = getc(fp); printf( \t %c,ch);
ch = getc(fp); printf( \t %c,ch);
fseek(fp,0L,SEEK_SET);
ch = getc(fp); printf( \t %c,ch);
fseek(fp,6L,SEEK_CUR);
ch = getc(fp); printf( \t %c,ch);
ch = getc(fp); printf( \t %c,ch);
fseek(fp,-2,SEEK_CUR);
ch = getc(fp); printf( \t %c,ch);
fseek(fp,4L,SEEK_CUR);
ch = getc(fp); printf( \t %c,ch);
fseek(fp,-1L,SEEK_CUR);
ch = getc(fp); printf( \t %c,ch);
fclose(fp)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started