Professional Documents
Culture Documents
set 1
set 1
#include <bits/stdc++.h>
using namespace std;
int next, i, j;
// Initialise NGE as -1
next = -1;
// Driver Code
int main()
{
// Given array arr[]
int arr[] = { 1, 2, 1 };
// Function call
printNGE(arr, N);
return 0;
}
#include <cstring>
#include <iostream>
using namespace std;
#define MAX 100
Node* S = newNode('a');
S->left = newNode('b');
S->left->left = newNode('c');
S->right = newNode('d');
if (isSubtree(T, S))
cout << "Yes: S is a subtree of T";
else
cout << "No: S is NOT a subtree of T";
return 0;
}