Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
AnswerRe: .NET 3 / WPF and simple stuff like "docking"? Pin
Judah Gabriel Himango10-Sep-06 13:41
sponsorJudah Gabriel Himango10-Sep-06 13:41 
GeneralRe: .NET 3 / WPF and simple stuff like "docking"? Pin
Jörgen Sigvardsson10-Sep-06 13:49
Jörgen Sigvardsson10-Sep-06 13:49 
AnswerRe: .NET 3 / WPF and simple stuff like "docking"? Pin
Steve Bickell10-Sep-06 20:22
Steve Bickell10-Sep-06 20:22 
QuestionUsing Array LIst Pin
aynka200010-Sep-06 7:23
aynka200010-Sep-06 7:23 
AnswerRe: Using Array LIst Pin
Judah Gabriel Himango10-Sep-06 7:35
sponsorJudah Gabriel Himango10-Sep-06 7:35 
GeneralRe: Using Array LIst Pin
aynka200010-Sep-06 8:55
aynka200010-Sep-06 8:55 
GeneralRe: Using Array LIst Pin
Nader Elshehabi10-Sep-06 9:16
Nader Elshehabi10-Sep-06 9:16 
QuestionUsing Binary Trees Pin
aynka200010-Sep-06 7:14
aynka200010-Sep-06 7:14 
I tried Using binary tree in c#
I just tried the insert,delete and find method using recursion
But I'm not sure whether is correct and how to use it in main Can somebody please tell is it correct
Thanks for checking

below is my coding

using System;

class Node
{
public int skey;
public Node nleft;
public Node nRight;

public Node left
{
get {return nleft; }
set {nleft=value; }
}

public Node right
{
get {return nRight; }
set {nRight=value; }
}

public int vkey
{
get {return skey; }
set {skey=value; }
}
}
class Tree
{
private Node root;


public Tree()
{
root = null;
}
//find
Node search_binary_tree(Node node,int key)
{
if (node==null)
return null; // not found

if (key < node.vkey)
return search_binary_tree(node.left, key);
else if (key > node.vkey)
return search_binary_tree(node.right, key);
else
return node;
}

void InsertNode(Node node,Node newNode )
{

if (root == null)
{
root =newNode;
}
else if (newNode.vkey <= node.vkey)
InsertNode(node.left, newNode);
else
InsertNode(node.right, newNode);
}

void DeleteNode(Node node)
{
Node temp = node;
if (node.left == null)
{
node = node.right;
temp=null;
}
else if (node.right == null)
{
node = node.left;
temp=null;
}
else
{
// Node has two children - get max of left subtree
temp = node.left;
while (temp.right != null)
{
temp = temp.right;
}
node.vkey = temp.vkey;
DeleteNode(temp);
}
}

void traverse_binary_tree(Node treenode)
{
if (treenode!=null)
{
traverse_binary_tree(treenode.left);
Console.WriteLine(treenode.vkey);
traverse_binary_tree(treenode.right);
}
}

So how can i apply main method for this
Please HelpSmile | :)

Ayn
AnswerRe: Using Binary Trees Pin
User 665810-Sep-06 7:37
User 665810-Sep-06 7:37 
QuestionRe: create a PKI certificate with RSA public/private key. Pin
edchan10-Sep-06 4:25
edchan10-Sep-06 4:25 
AnswerRe: create a PKI certificate with RSA public/private key. Pin
Nader Elshehabi10-Sep-06 5:03
Nader Elshehabi10-Sep-06 5:03 
GeneralRe: create a PKI certificate with RSA public/private key. Pin
edchan10-Sep-06 5:49
edchan10-Sep-06 5:49 
GeneralRe: create a PKI certificate with RSA public/private key. Pin
Nader Elshehabi10-Sep-06 6:00
Nader Elshehabi10-Sep-06 6:00 
QuestionHow can I implement IPC between two applications(VB and C# ) Pin
Orchid8510-Sep-06 4:23
Orchid8510-Sep-06 4:23 
AnswerRe: How can I implement IPC between two applications(VB and C# ) Pin
Nader Elshehabi10-Sep-06 4:54
Nader Elshehabi10-Sep-06 4:54 
QuestionConnectionTimeout Pin
TAREQ F ABUZUHRI10-Sep-06 4:01
TAREQ F ABUZUHRI10-Sep-06 4:01 
AnswerRe: ConnectionTimeout Pin
TAREQ F ABUZUHRI10-Sep-06 4:41
TAREQ F ABUZUHRI10-Sep-06 4:41 
AnswerRe: ConnectionTimeout Pin
Nader Elshehabi10-Sep-06 4:50
Nader Elshehabi10-Sep-06 4:50 
GeneralRe: ConnectionTimeout Pin
TAREQ F ABUZUHRI10-Sep-06 6:00
TAREQ F ABUZUHRI10-Sep-06 6:00 
GeneralRe: ConnectionTimeout Pin
Nader Elshehabi10-Sep-06 6:06
Nader Elshehabi10-Sep-06 6:06 
QuestionShow sort header arrow and image in listview 2.0 Pin
ika210-Sep-06 1:23
ika210-Sep-06 1:23 
AnswerRe: Show sort header arrow and image in listview 2.0 Pin
Nader Elshehabi10-Sep-06 3:17
Nader Elshehabi10-Sep-06 3:17 
GeneralRe: Show sort header arrow and image in listview 2.0 Pin
ika210-Sep-06 3:34
ika210-Sep-06 3:34 
GeneralRe: Show sort header arrow and image in listview 2.0 Pin
Nader Elshehabi10-Sep-06 4:38
Nader Elshehabi10-Sep-06 4:38 
GeneralRe: Show sort header arrow and image in listview 2.0 Pin
Arjun "Mjolnir" Bahree10-Sep-06 3:38
Arjun "Mjolnir" Bahree10-Sep-06 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.