Sunday, 21 May 2017

DSA Lab 6: Trees and their traversals

Task:

Implement the class "MyTree" as discussed in class (your tree should be a binary tree - each node have 2 children). For this you have to write a class "MyNode" and create whole tree class using this node class. Your class contains all necessary functions with the additions of these functions:

  • display_DFS()        //this will display the whole tree in depth first manner
  • display_BFS()        //this will display the whole tree in breath first manner
  • MyTress()        //this is the constructor, it will take array of integers and create the whole tree with these integers

No comments :

Post a Comment