preorder_tree_construction minor changes.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
VIM: let b:lcppflags="-std=c++11 -O2 -pthread"
|
||||
VIM: let b:wcppflags="/O2 /EHsc /DWIN32"
|
||||
VIM: let b:argv=""
|
||||
*/
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@@ -53,7 +58,6 @@ node * prefix_to_tree( const std::vector<double>& v ){
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << root << std::endl;
|
||||
return root;
|
||||
}
|
||||
|
||||
@@ -74,8 +78,9 @@ void traverse( node * root, std::vector<double>& v ){
|
||||
}
|
||||
|
||||
void test( const std::vector<double>& v ){
|
||||
std::cout << "-----------------------------------------------------" << std::endl;
|
||||
auto r = prefix_to_tree( v );
|
||||
//print( r );
|
||||
print( r );
|
||||
std::vector<double> w;
|
||||
traverse( r, w );
|
||||
if ( v.size() != w.size() ) {
|
||||
|
||||
Reference in New Issue
Block a user