Click here to Skip to main content
15,892,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hole Punching C#->PHP Pin
Mohd Iliyas Ahmad10-Jan-10 20:11
Mohd Iliyas Ahmad10-Jan-10 20:11 
QuestionRe: stack overflow Pin
hotthoughtguy11-May-09 8:18
hotthoughtguy11-May-09 8:18 
AnswerRe: stack overflow Pin
EliottA11-May-09 8:21
EliottA11-May-09 8:21 
GeneralRe: stack overflow Pin
Christian Graus11-May-09 8:22
protectorChristian Graus11-May-09 8:22 
GeneralRe: stack overflow Pin
EliottA11-May-09 8:24
EliottA11-May-09 8:24 
GeneralRe: stack overflow Pin
Vikram A Punathambekar11-May-09 18:45
Vikram A Punathambekar11-May-09 18:45 
AnswerRe: stack overflow Pin
Christian Graus11-May-09 8:22
protectorChristian Graus11-May-09 8:22 
GeneralRe: stack overflow Pin
hotthoughtguy11-May-09 8:33
hotthoughtguy11-May-09 8:33 
yup its increaing exponentially. thats the code

private void button1_Click(object sender, EventArgs e)
{
listView1.Items.Clear();
lst.Clear();
str.Clear();
dummy = textBox1.Text.ToCharArray() ;
for (int i = 0; i < dummy.Length; i++)
str.Add(dummy[i]);
for (int i = 0; i < str.Count; i++)
{
root = new Node();
first(root);
recursive(root);

addlist(root, null);
char c = str[0];
str.RemoveAt(0);
str.Add(c);
}
lstview(); // adding lst to listview
}




private void addlist(Node current, Node parant)
{
if (current == null)
{
try
{
ch.RemoveAt(ch.Count - 1);
if (parant.NextCousion == null)
{
ch.RemoveAt(ch.Count - 1);
addlist(parant.parant.NextCousion, parant.parant.parant);
}
else
addlist(parant.NextCousion,parant.parant);
}
catch
{
return;
}
return;
}
ch.Add(current.data);
if(current.childerns.Count>0)
addlist(current.childerns[0],current);
if (current.childerns.Count == 0)
{
string s = "";
for (int i = 0; i < ch.Count; i++)
s += ch[i];
if(!lst.Contains(s))
lst.Add(s);
ch.RemoveAt(ch.Count - 1);
}
else
{
try
{
ch.RemoveAt(ch.Count - 1);
}
catch
{
return;
}
addlist(current.NextCousion,current.parant);
}
}

public void recursive(Node current)
{
for (int i = 0; i < str.Count- 1; i++)
layers(current.childerns[i]);
}

public void setingcousion(Node current)
{
int limit = current.childerns.Count;
for (int i = 0; i < limit; i++)
{
if (i == 0)
current.childerns[0].PreCousion = null;
else
{
current.childerns[i].PreCousion = current.childerns[i - 1];
current.childerns[i-1].NextCousion = current.childerns[i];
}
current.childerns[i].parant = current;
}
}

private void layers(Node current)
{
if (current == null)
return;
current.cousions = new List<Node>();
current.childerns = new List<Node>();
for (int i = 0; i < current.parant.childerns.Count ; i++)
{
if (current != current.parant.childerns[i])
{
current.cousions.Add(new Node(current.parant.childerns[i].data));
current.childerns.Add(new Node(current.parant.childerns[i].data));
}
}
for (int i = 0; i < current.childerns.Count; i++)
{
current.childerns[i].parant = current;
current.cousions[i].parant = current.parant;
}
setingcousion(current);
if (current.childerns.Count == 0)
{
layers(current.parant.NextCousion);
return;
}
for (int i = 0; i < current.childerns.Count; i++)
layers(current.childerns[i]);
}
GeneralRe: stack overflow Pin
hotthoughtguy11-May-09 8:37
hotthoughtguy11-May-09 8:37 
AnswerRe: stack overflow Pin
Luc Pattyn11-May-09 9:13
sitebuilderLuc Pattyn11-May-09 9:13 
Questionproxy server Pin
yogesh_softworld12311-May-09 7:41
yogesh_softworld12311-May-09 7:41 
QuestionButtons and form show and close Pin
Star0911-May-09 7:30
Star0911-May-09 7:30 
QuestionRe: Buttons and form show and close Pin
harold aptroot11-May-09 7:32
harold aptroot11-May-09 7:32 
GeneralRe: Buttons and form show and close Pin
Star0911-May-09 7:51
Star0911-May-09 7:51 
GeneralRe: Buttons and form show and close Pin
harold aptroot11-May-09 8:12
harold aptroot11-May-09 8:12 
AnswerRe: Buttons and form show and close Pin
DaveyM6911-May-09 7:52
professionalDaveyM6911-May-09 7:52 
GeneralRe: Buttons and form show and close Pin
Star0911-May-09 7:55
Star0911-May-09 7:55 
Questionerror when created new datasource Pin
dotnetdev8111-May-09 7:18
dotnetdev8111-May-09 7:18 
Questionstack overflow Pin
hotthoughtguy11-May-09 6:21
hotthoughtguy11-May-09 6:21 
QuestionRe: stack overflow Pin
Ian McCaul11-May-09 6:26
Ian McCaul11-May-09 6:26 
AnswerRe: stack overflow Pin
J4amieC11-May-09 6:34
J4amieC11-May-09 6:34 
AnswerRe: stack overflow Pin
Dan Neely11-May-09 6:56
Dan Neely11-May-09 6:56 
AnswerRe: stack overflow Pin
Dave Kreskowiak11-May-09 7:00
mveDave Kreskowiak11-May-09 7:00 
GeneralRe: stack overflow Pin
hotthoughtguy11-May-09 7:12
hotthoughtguy11-May-09 7:12 
GeneralRe: stack overflow Pin
Luc Pattyn11-May-09 7:27
sitebuilderLuc Pattyn11-May-09 7:27 

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.