Tag Archives: recursive

Display tooltips for TreeView nodes in C#

At design time, I added a TreeView control to the form. I also added an associated ImageList control to hold images for the TreeView control’s nodes, and I set the TreeView control’s ImageList property to the ImageList control. Finally I … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , , , | 1 Comment

Draw a recursive von Koch snowflake fractal in C#

   This example shows how to draw a von Koch snowflake fractal. It uses the same techniques described in the post Draw a recursive snowflake fractal in C#. The DrawSnowflake and DrawSnowflakeEdge methods are exactly the same as before. The … Continue reading

Posted in algorithms, drawing, fractals, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Draw a recursive snowflake fractal in C#

   This program draws a recursive snowflake fractal by using an initiator and a generator to define the fractal’s shape. The initiator is a curve that represent the fractal’s basic shape. In this case, the initiator is the triangle shown … Continue reading

Posted in algorithms, drawing, fractals, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , | 14 Comments

Draw a colored binary tree in C#

This example shows how you can modify the example Recursively draw a binary tree in C# to draw a colored binary tree. It draws branches at different depths in different colors and with different thicknesses. The main recursive method in … Continue reading

Posted in algorithms, drawing, fractals, graphics | Tagged , , , , , , , , , , , , , , , , | 1 Comment

Recursively draw a binary tree in C#

This example shows how you can use recursion to draw a binary tree. Recursion occurs when a method calls itself. It may call itself directly (simple recursion) or indirectly by calling another method that calls the first (indirect recursion). It … Continue reading

Posted in algorithms, drawing, fractals, graphics | Tagged , , , , , , , , , , , , , , | 10 Comments

Draw a Hilbert curve fractal in C#

The remarkably short Hilbert subroutine draws the Hilbert curve. It takes as parameters the depth of recursion, and dx and dy values that give the direction in which it should draw. It recursively draws four smaller Hilbert curves and connects … Continue reading

Posted in algorithms, fractals, graphics | Tagged , , , , , , , , , , | 4 Comments