I want to visualized my algorithms

1. I want to write solutions to algorithm and data structure problems.
2. I then want to be able to create animations on a web browser that would bring these animations to life.

I want the bulk of this project to be written in C++ and another language to handle the animations part on the web browser. Could I use Python for this?

If so, how do I integrate them?
1) ok. There are literally thousands of books and online code etc on this. Is there a question in there?

2) this is harder. you can use c++ to generate the web page, but its a lot of trouble.
I don't know what python can do, but I assume it supports some form of graphics/gui and can probably do the trick.

I would compile the c++ to a library and have the python call the c++ functions that way.
you can also call the c++ as an executable that, for example, writes to a file or redirects its console output to a file, and have the python kick off the program and read the file. This lets the c++ be a stand alone executable that does its thing and the python is sort of an afterthought, not required to run it. Depends on what you want mostly. the library is cleaner, for most common uses. You can also share memory, but that is frustrating in some languages and I don't know what python does here.
Last edited on
(1.) Personally, I've read Introduction to Algorithms, by Thomas H. Cormen, but I have no idea if this is better or worse than other data structure books. Tutorials online and just practicing it helped me equally or more than any book.

(2.) Look into Javascript, HTML 5 Animation, or WebGL (or a combination). Adobe Shockwave/Flash is a... bit outdated, sadly. I haven't done much web programming/animation. But as jonnin said, you could have the C++ generate other files that then are eventually read from the web browser.

PS: Doesn't have anything to do with data structures in itself, but agar.io was (is?) a popular web game, with animations, that was written in JavaScript and C++.
https://en.wikipedia.org/wiki/Agar.io
Just having animations without user-user interaction would of course be much simpler, so maybe it's not the best example. Try searching open source sites like GitHub for "web animation".
Last edited on
Not much idea on python. I just wanted to bring to your notice that to create animations on a web brower you may like to look at P5.js which is a javascript library designed for creative coding. It will make animating on web much easier. Its easy to learn and you can find tutorials on YouTube channel "The Coding Train".
Last edited on
Topic archived. No new replies allowed.