Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("date.in");
- int st[101],dr[101],i,j,n,v[101],c=1;
- struct nod{
- int info;
- nod* st;
- nod* dr;
- };
- nod* v,z;
- int main(){
- f>>n;
- for(i=1;i<=n;i++){
- f>>v[i];
- }
- for(i=1;i<=n;i++){
- st[i]=v[2*i];
- dr[i]=v[2*i+1];
- cout<<v[i]<<" "<<st[i]<<" "<<dr[i]<< " " ;
- cout<<endl;
- }
- for(i=1;i<=n;i++){
- if(st[i]>v[i] || (dr[i]<v[i] &&dr[i])){
- c=0;
- break;
- }
- }
- if(c) cout<<"Arborele este de cautare";
- else cout<<"Arborele nu este de cautare";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement