Nutanix Interview Question

Binary search tree based question, Write function to return all permutations of valid IP address given a string with digits.