How to create a binary tree of value type String by C#
i don't want binary tree search i just want to make binary tree of value string to do some algorithm like BFS & DFS .. )
How to create a binary tree of value type String by C#
i don't want binary tree search i just want to make binary tree of value string to do some algorithm like BFS & DFS .. )
You can start with a simple node class as shown below. Here Data represents a string value like you've mentioned. You can change this to int or any other type.
public class BinaryTreeNode
{
public string Data { get; set; }
public BinaryTreeNode Left { get; set; }
public BinaryTreeNode Right { get; set; }
public BinaryTreeNode(string data)
{
Data = data;
}
}
Why don't you start by taking a look at some of these articles