This is a python program which will generate category tree with the root as given category.