Last login: Fri Jun 23 00:14:43 on console
hasegawanarumi-no-MacBook-Air:~ RAMUNE$ ls
Applications	Documents	Library		Music		Public
Desktop		Downloads	Movies		Pictures	UoA
hasegawanarumi-no-MacBook-Air:~ RAMUNE$ pwd
/Users/RAMUNE
hasegawanarumi-no-MacBook-Air:~ RAMUNE$ cd UoA/2nd/1sem/Alg/
hasegawanarumi-no-MacBook-Air:Alg RAMUNE$ ls
ALDS1_1_A-in1.txt	Lec6			topic1-1.c
Doubly.c		Lec7			w00.pdf
Lec3			Lec8			w02.pdf
Lec4			a.out
Lec5			lec2-3.c
hasegawanarumi-no-MacBook-Air:Alg RAMUNE$ mkdir Lec9
hasegawanarumi-no-MacBook-Air:Alg RAMUNE$ bash
bash-3.2$ pwd
/Users/RAMUNE/UoA/2nd/1sem/Alg
bash-3.2$ cd Lec9
bash-3.2$ gcc Complete.c 
Complete.c:17:5: error: use of undeclared identifier 'for9i'
    for9i=0;i<n;i++){
    ^
Complete.c:17:20: error: expected ';' after expression
    for9i=0;i<n;i++){
                   ^
                   ;
Complete.c:17:20: error: expected expression
Complete.c:17:14: warning: relational comparison result unused
      [-Wunused-comparison]
    for9i=0;i<n;i++){
            ~^~
1 warning and 3 errors generated.
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3

^C
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[0] key = 7 , parent = 7
T[1] key = 8 , parent = 7
T[2] key = 1 , parent = 8
T[3] key = 2 , parent = 8
T[4] key = 3 , parent = 1
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[0] key = 1234723 , parent = 0
T[1] key = 7 , parent = 1234723
T[2] key = 8 , parent = 7
T[3] key = 1 , parent = 7
T[4] key = 2 , parent = 8
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[1] key = 7 , parent = 1234914
T[2] key = 8 , parent = 7
T[3] key = 1 , parent = 7
T[4] key = 2 , parent = 8
T[5] key = 3 , parent = 8
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[1] key = 7 , parent = -1
T[2] key = 8 , parent = 7
T[3] key = 1 , parent = 7
T[4] key = 2 , parent = 8
T[5] key = 3 , parent = 8
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
node 1 : key = 7, left key = 8, right key = 1, parent = -1 
node 2 : key = 8, left key = 2, right key = 3, parent = 7 
node 3 : key = 1, left key = -1, right key = -1, parent = 7 
node 4 : key = 2, left key = -1, right key = -1, parent = 8 
node 5 : key = 3, left key = -1, right key = -1, parent = 8 
bash-3.2$ gcc Complete.c 
Complete.c:37:27: warning: implicit declaration of function 'print' is invalid
      in C99 [-Wimplicit-function-declaration]
        if(T[i].right!=-1)print("right key = %d, ",T[i].right);
                          ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_print", referenced from:
      _main in Complete-da8c2d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
node 1 : key = 7 left key = 8, right key = 1, 
node 2 : key = 8 parent key = 7, left key = 2, right key = 3, 
node 3 : key = 1 parent key = 7, 
node 4 : key = 2 parent key = 8, 
node 5 : key = 3 parent key = 8, 
bash-3.2$ 