Complete the following Haskell function definitions. Unlessstated otherwise do not use library
functions that are not in the Haskell standard prelude.
Consider the following definition for a binary tree.
data Tree a = Leaf a | Node (Tree a) (Tree a)
A binary tree is balanced if, at every node, the difference betweenthe number
of leaves appearing in the left and right subtree is at most one.(A tree which
contains just one leaf is considered balanced.)
Write the function isBalanced :: Tree a -> Bool that decides ifthe tree is balanced.
Hint: first write a function size::Tree a -> Int that countsleaves in a tree.
isBalanced (Node (Node (Leaf
PayPal Gateway not configured
PayPal Gateway not configured