Category Archives: generic

Draw a scrolling family tree in C#

The example Draw a family tree in C# shows how to draw a family tree. Unfortunately if the tree is too big, you can’t make the form big enough to display it all. One solution would be to use smaller … Continue reading

Posted in algorithms, classes, generic, graphics, OOP | Tagged , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Compare a list priority queue to a heap priority queue in C#

My book Essential Algorithms: A Practical Approach to Computer Algorithms describes lots of other interesting data structures and algorithms, many just as interesting but less complicated than this one. For more information about queues, priority queues, trees and other algorithmic … Continue reading

Posted in algorithms, classes, generic, mathematics, OOP | Tagged , , , , , , , , , , , , | 1 Comment

Make an efficient priority queue class in C#, Part 2

My book Essential Algorithms: A Practical Approach to Computer Algorithms describes lots of other interesting data structures and algorithms, many just as interesting but less complicated than this one. For more information about queues, priority queues, trees and other algorithmic … Continue reading

Posted in algorithms, classes, generic, mathematics, OOP | Tagged , , , , , , , , , , , , | Leave a comment

Make an efficient priority queue class in C#, Part 1

For more information about queues, priority queues, trees and other algorithmic topics, see my book Essential Algorithms: A Practical Approach to Computer Algorithms. A priority queue is a data structure that holds data values with associated priorities. The Enqueue method … Continue reading

Posted in algorithms, classes, generic, mathematics, OOP | Tagged , , , , , , , , , , , , | 1 Comment

Make a generic TreeNode class with link weights in C#

The post Handle generic TreeNode mouse events in C# explains how you can build and draw a tree where the nodes contain generic items. This example adds the ability to display link weights. The generic TreeNode class now has a … Continue reading

Posted in algorithms, classes, generic, OOP | Tagged , , , , , , , , , , , , , | 6 Comments

Make a list without duplicates in C#

This example builds a list of Person objects without duplicates. The following code shows the Person class. public class Person : IEquatable<Person> { public string FirstName, LastName; public Person(string first_name, string last_name) { FirstName = first_name; LastName = last_name; } … Continue reading

Posted in generic, lists | Tagged , , , , , , , , , , , | Leave a comment

Make generic Min and Max methods in C#

This example shows how you can make generic Min and Max methods to find the minimum and maximum values in a sequence of parameters. The Math namespace’s Min and Max methods are very useful, but they have two big drawbacks. … Continue reading

Posted in algorithms, arrays, calculations, generic, methods | Tagged , , , , , , , , , , , , , , | Leave a comment

Draw a family tree in C#

This example shows how to use the generic TreeNode class to draw a family tree. The example Draw a tree with nodes containing pictures in C# draws a picture showing part of the British royal family tree. It works, but … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , , , , , , , | 10 Comments

Draw a tree with nodes containing pictures in C#

This example uses the generic TreeNode class described in the following posts to draw a tree with nodes containing pictures. Make a generic TreeNode class in C#, Part 1 Make a generic TreeNode class in C#, Part 2 The program … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , , , , , , | 1 Comment

Make a generic TreeNode class in C#, Part 2

This post explains how the TreeNode class uses its generic TreeNode class to arrange and draw a tree. For information about that classes used by this example and how to define the generic TreeNode class it uses, see Make a … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , | 4 Comments