Gate Exam

We are given a set of n distinct elements and an unlabeled binary tree with n nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree?

Read Solution (Total 1)

Gate Other Question

Four matrices M1, M2, M3 and M4 are dimensions p × q, q × r, r × s and s × t respectively can be multiplied in several ways with different number of total scalar multiplications. For example When multiplied as (( ) ( )) 1 2 3 4 M ×M × M ×M the total number of scalar multiplications is pqr+rst+prt. When multiplied as ((( ) ) ) 1 2 3 4 M ×M ×M ×M , the total number of scalar multiplications is pqr+prs+pst.
If p=10, q=100, r=20, s=5 and t=80, then the minimum number of scalar
multiplications needed is??
A deck of 5 cards (each carrying a distinct number from 1 to 5) is shuffled thoroughly. Two cards are then removed one at a time from the deck. What is the probability that the two cards are selected with the number on the first card being one higher than the number on the second card?