print tree cpp code example

Example 1: java print treemap

for (Map.Entry<K, V> entry : myMap.entrySet()) {
     System.out.println("Key: " + entry.getKey() + ". Value: " + entry.getValue());
}

Example 2: tree in c++ stl

// C++ STL library does not provide any non linear data structure like
// Trees and Graphs
// it only provides linear data structures like 
// vector , list , map , stack , queue etc..
// https://www.geeksforgeeks.org/binary-tree-data-structure/
// https://www.geeksforgeeks.org/graph-implementation-using-stl-for-competitive-programming-set-1-dfs-of-unweighted-and-undirected/

Tags:

Java Example