background preloader

Welcome

Welcome
Warning: LiteratePrograms is currently undergoing a license migration to Creative Commons CC0 1.0. All content will be erased unless its authors agree to release it under CC0. If you wish for your contributed content to be retained, please add a statement to your user page that you release all your contributions under CC0 1.0, and inform me via Special:Emailuser/Dcoetzee. You can also re-add content that you created after the migration, provided that you are the sole author. At this time all article namespace content is already migrated. Based on Donald Knuth's concept of literate programming, LiteratePrograms is a collection of code samples displayed in an easy-to-read way, collaboratively edited and debugged, and all released into the public domain under the Creative Commons CC0 1.0 waiver (see Copyrights) so that anyone can use our code and text for any purpose without restriction. If you're interested in contributing your own programs, you can read about how to write an article.

Programming, Software, and Technical Interview Questions - XOR Swap Tree traversal Types[edit] Pre-order: F, B, A, D, C, E, G, I, H In-order: A, B, C, D, E, F, G, H, I Post-order: A, C, E, D, B, H, I, G, F Level-order: F, B, G, A, D, I, C, E, H Compared to linear data structures like linked lists and one-dimensional arrays, which have a canonical method of traversal (namely in linear order), tree structures can be traversed in many different ways. The name given to a particular style of traversal comes from the order in which nodes are visited. For the purpose of illustration, it is assumed that left nodes always have priority over right nodes. Depth-first traversal is easily implemented via a stack, including recursively (via the call stack), while breadth-first traversal is easily implemented via a queue, including corecursively. Beyond these basic traversals, various more complex or hybrid schemes are possible, such as depth-limited searches such as iterative deepening depth-first search. Depth-first[edit] Pre-order[edit] In-order (symmetric)[edit] Post-order[edit] etc.

Clever Algorithms Learn jQuery in 30 Days Reactive programming is a way of coding with asynchronous data streams that makes a lot of problems easier to solve. RxJS is a popular library for reactive...Once in a while, it's important for us as developers to go back to what made us excited about computers in the first place. For Derek Jensen, that is gaming....React is a flexible framework that makes it easy to build single-page web applications. One of its tools is a set of lifecycle methods which you can add to...The PixelSquid plugin for Photoshop is an exciting new technology that provides the benefits of 3D elements without having to understand a 3D program or the...How your app looks is as important as how it works, and animation is an important part of modern user interfaces.

Graph traversal Redundancy[edit] Unlike tree traversal, graph traversal may require that some nodes be visited more than once, since it is not necessarily known before transitioning to a node that it has already been explored. As graphs become more dense, this redundancy becomes more prevalent, causing computation time to increase; as graphs become more sparse, the opposite holds true. Thus, it is usually necessary to remember which nodes have already been explored by the algorithm, so that nodes are revisited as infrequently as possible (or in the worst case, to prevent the traversal from continuing indefinitely). This may be accomplished by associating each node of the graph with a "color" or "visitation" state during the traversal, which is then checked and updated as the algorithm visits each node. Several special cases of graphs imply the visitation of other nodes in their structure, and thus do not require that visitation be explicitly recorded during the traversal. Depth-first search[edit]

Cheat Sheet : All Cheat Sheets in one page Show HN: Help us curate the web’s best content for learning programming & design Link here: Despite all the educational material on the web, I found it pretty hard to learn how to code and design. I had trouble finding high-quality content, figuring out what to learn next, and staying motivated without easy ways to track my progress. So, my co-founder and I built Polymath. Our MVP is pretty simple right now: you can find & submit good content, bookmark & track your progress across different resources, and rate/comment on the material. We're really excited about going live, and we'd love your feedback & comments. Introduction to Algorithms - Massachusetts Institute of Technology Readings refer to chapters and/or sections of Introduction to Algorithms, 3rd Edition. See the table of contents.

Related: