Generation

code to explanationFri, 14 Apr 2023

template<typename T> void ordenarAbbREC(const Abb<T>& n, std::vector<T>& v) { if(!n.vacio()) { ordenarAbbREC(n.izqdo(), v); v.push_back(n.elemento()); ordenarAbbREC(n.drcho(), v); } }

This function does a recursive inorder traversal of the tree n and adds the nodes to the vector v.

Questions about programming?Chat with your personal AI assistant