fork download
  1. struct node
  2. {
  3. int date;
  4. node *lc;
  5. node *rc;
  6. };
  7.  
  8.  
  9. void vin(int k)
  10. {
  11. node *t=new node;
  12. t->date = k;
  13. t->lc=NULL;
  14. t->rc=NULL;
  15. if(start == NULL)
  16. {
  17. start=t;
  18. }
  19. else if(start->date < k)
  20. {
  21. if(start->rc==NULL)
  22. start->rc=t;
  23. else
  24. {
  25. start = start->rc;
  26. vin(k);
  27. }
  28. }
  29. else
  30. {
  31. if(start->lc==NULL)
  32. start->lc=t;
  33. else
  34. {
  35. start = start->lc;
  36. vin(k);
  37. }
  38. }
  39. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void vin(int)’:
prog.cpp:13:25: error: ‘NULL’ was not declared in this scope
                   t->lc=NULL;
                         ^
prog.cpp:15:22: error: ‘start’ was not declared in this scope
                   if(start == NULL)
                      ^
stdout
Standard output is empty