Skip to content

Improve heapq documentation #133530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
StanFromIreland opened this issue May 6, 2025 · 2 comments
Open

Improve heapq documentation #133530

StanFromIreland opened this issue May 6, 2025 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@StanFromIreland
Copy link
Contributor

StanFromIreland commented May 6, 2025

With the implementation of max-heaps, the docs should be revised with examples and descriptions for both.

The docs should also be made more formal (#62480)

I will be working on this.

Linked PRs

@encukou
Copy link
Member

encukou commented May 8, 2025

The image looks generated. If it is, would you mind including instructions/scripts for making it, for the benefit of future editors? Even if they're platform-/tool-specific and they'd only work as inspiration.

@StanFromIreland
Copy link
Contributor Author

The image looks generated.

That's because it is. :-)

instructions/scripts for making it

I used tkiz, so it should work on any platform.

My code for the binary tree
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{trees}

\begin{document}
\begin{tikzpicture}[
  level 1/.style={sibling distance=80mm},
  level 2/.style={sibling distance=40mm},
  level 3/.style={sibling distance=20mm},
  level 4/.style={sibling distance=10mm},
  every node/.style={
    circle,
    draw=blue,
    fill=blue!20,
    minimum size=6mm
  }
]
\node {0}
  child {node {1}
    child {node {3}
      child {node {7}
        child {node {15}}
        child {node {16}}
      }
      child {node {8}
        child {node {17}}
        child {node {18}}
      }
    }
    child {node {4}
      child {node {9}
        child {node {19}}
        child {node {20}}
      }
      child {node {10}
        child {node {21}}
        child {node {22}}
      }
    }
  }
  child {node {2}
    child {node {5}
      child {node {11}
        child {node {23}}
        child {node {24}}
      }
      child {node {12}
        child {node {25}}
        child {node {26}}
      }
    }
    child {node {6}
      child {node {13}
        child {node {27}}
        child {node {28}}
      }
      child {node {14}
        child {node {29}}
        child {node {30}}
      }
    }
  };
\end{tikzpicture}
\end{document}

Then generated the pdf (pdflatex) and converted it to an svg (there are many ways to do this). There are other ways to generate it but that is just the one I am most familiar with.

If there are other similar text diagrams in the docs I am happy to replace them with images. They look much better, are clearer, and scale better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Status: Todo
Development

No branches or pull requests

2 participants