Question: 5 marks 4 Q 9. Classify following arrays as: Full binary tree, Complete binary tree, or Pathological binary tree. a) 1 2 3 5 b)

5 marks 4 Q 9. Classify following arrays as: Full binary tree, Complete binary tree, or Pathological binary tree. a) 1 2 3 5 b) 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 d) 1 2 3 e) 2 3 4 5 6 7 8 9 10 Index 0 1 2 3 4 5 6 7 8 9 Q 10. Classify following codes as: Non-binary tree, Binary-tree, or Graph. Also justify your answers in just two lines (for each case): 4 1 8 marks a) int x[100); b) struct node{ int data; node *L; node*R; int main() { cout>x[i]; } int main() { node *n4, * n5,* n6; n4 = new node; n5 = new node; n6 = new node; n4->data=n5->data=n6->data=9; n4->L=n5; n5->L=n6; n6->L=n4; n4->R=n5->R=n6->R=NULL; c) struct node{ int data; node *L; node*R; }; d) struct node{ int data; node *L; node*R; int main() { node *n1,*n2,* n3; n1 = new node; n2 = new node; n3 = new node; cin>>n1->data>>n2->data>>n3->data; n1->R=n2; n2->R=n3; n1->L=n2->L=n3->L=n3->R=NULL; } int main() { node *n7,*n8,* n9; n7 = new node; n8 = new node; n9 = new node; n7->data=n8->data=n9->data=11; n7->L=n9; n 9->L=n8; n8->L=NULL; n7->R=n9->R=n8->R=NULL; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
