Type the Question

Saturday, February 16, 2019

Question Name:Binary Search tree

#include <stdio.h>
int main()
{
int a;
  scanf("%d",&a);
  if(a%2==0) { printf("Yes"); } 
  else { printf("No"); } 
 return 0;
}

Problem Description

Given a binary search tree and a sorted sub-sequence. the task is to check if the given sorted sub-sequence exist in binary search tree or not.
200px-Binary_search_tree.svg
Examples:
// For binary search tree
Input : seq[] = {4, 6, 8, 14}
Output: “Yes”
Input : seq[] = {1, 2, 3, 8}
Output: “No”
  • Test Case 1
    Input (stdin)
    0
    Expected Output
    Yes
  • Test Case 2
    Input (stdin)
    0
    Expected Output
    0

No comments:

Post a Comment

Question Name:TOWER OF HANOI

#include < bits / stdc ++. h > #define lli long long using namespace std ; lli dp [ 202 ]; int main () { int t , n ; ...