Data Structures/Heaps/Binomial Heap.cpp
// Visualizes the heap using GraphViz.
Visualizes the heap using GraphViz.
Visualizes the heap using GraphViz .
void BinomialHeap::Draw(std::string name) {
  std::ofstream dot_file;
  dot_file.open(name + ".dot");
  dot_file << "digraph{\n";
  Node* root = head;
  while (root != NULL) {
    PrintToDot(root, dot_file);
    root = root -> right;
  }
  dot_file << "}\n";
  dot_file.close();
  std::string command = "dot -Tpng " + name + ".dot -o " + name + ".png";
  system(command.c_str());
}
void BinomialHeap :: Draw ( std :: string name ) { std :: ofstream dot_file ; dot_file . open ( name + " " ) ; dot_file << " \n " ; Node * root = head ; while ( root != NULL ) { PrintToDot ( root , dot_file ) ; root = root -> right ; } 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 .