Data Structures/Heaps/Binary Heap.cpp
// Visualizes the heap using GraphViz.
Visualizes the heap using GraphViz.
Visualizes the heap using GraphViz .
void BinaryHeap::Draw(std::string name) {
  std::ofstream dot_file;
  dot_file.open(name + ".dot");
  dot_file << "digraph{\n";
  PrintToDot(1, dot_file);
  dot_file << "}\n";
  dot_file.close();
  std::string command = "dot -Tpng " + name + ".dot -o " + name + ".png";
  system(command.c_str());
}
void BinaryHeap :: Draw ( std :: string name ) { std :: ofstream dot_file ; dot_file . open ( name + " " ) ; dot_file << " \n " ; PrintToDot ( 1 , dot_file ) ; dot_file << " \n " ; dot_file . close ( ) ; std :: string command = " " + name + " " + name + " " ; system ( command . c_str ( ) ) ; }
Visualizes the heap using GraphViz.
Visualizes the heap using GraphViz .