7 Replies - 11216 Views - Last Post: 23 April 2009 - 11:49 PM Rate Topic: -----

#1 b007  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-April 09

BFS Code in C# Or VB

Posted 20 April 2009 - 01:39 PM

Hi,

I'm looking for BFS Code in C# or VB.
Can u help me with that?

Thanks..
Is This A Good Question/Topic? 0
  • +

Replies To: BFS Code in C# Or VB

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: BFS Code in C# Or VB

Posted 20 April 2009 - 01:46 PM

Well here we don't just give people source code because they ask for it, we require some effort on your part. Also, what is BFS?!

[rules][/rules]
Was This Post Helpful? 1
  • +
  • -

#3 naz2009  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 21-April 09

Re: BFS Code in C# Or VB

Posted 21 April 2009 - 05:44 AM

bfs is breath first searching which mean how to search for one node in queue to fining the path to it
also there is Dfs depth first searching.....


i wanna know how to do this in windows form application in c#....
this is the algorithem...

Step 1: Initialize all nodes to ready state (status = 1)
Step 2: Put the starting node in queue and change its status to the waiting state (status = 2)
Step 3: Repeat step 4 and 5 until queue is empty
Step 4: Remove the front node n of queue. Process n and change the status of n to the processed state (status = 3)
Step 5: Add to the rear of the queue all the neighbors of n that are in ready state (status = 1), and change their status to the waiting state (status = 2).
[End of the step 3 loop]
Step 6: Exit


if any one know how i can do this in c# please help me...
Was This Post Helpful? 0
  • +
  • -

#4 papuccino1  Icon User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 63
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Re: BFS Code in C# Or VB

Posted 21 April 2009 - 06:12 AM

What particular area are you having trouble with?

Some tips:

1. Write what your code is supposed to do in normal sequencial English.

2. Try to pinpoint what controls you are planning are using and design methods once again in plain old English.
Was This Post Helpful? 0
  • +
  • -

#5 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: BFS Code in C# Or VB

Posted 21 April 2009 - 09:26 AM

View Postnaz2009, on 21 Apr, 2009 - 04:44 AM, said:

bfs is breath first searching which mean how to search for one node in queue to fining the path to it
also there is Dfs depth first searching.....


i wanna know how to do this in windows form application in c#....
this is the algorithem...

Step 1: Initialize all nodes to ready state (status = 1)
Step 2: Put the starting node in queue and change its status to the waiting state (status = 2)
Step 3: Repeat step 4 and 5 until queue is empty
Step 4: Remove the front node n of queue. Process n and change the status of n to the processed state (status = 3)
Step 5: Add to the rear of the queue all the neighbors of n that are in ready state (status = 1), and change their status to the waiting state (status = 2).
[End of the step 3 loop]
Step 6: Exit


if any one know how i can do this in c# please help me...


(Not trying to toot my own horn)

You could look at these tutorials I've written about queues to give you an idea how the queue collection works. There is one in VB and one in C#.

Using queues in VB.NET

Using queues in C#

If they don't help much leave a reply with the code you have tried and I think everybody would be happy to help you.
Was This Post Helpful? 0
  • +
  • -

#6 papuccino1  Icon User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 63
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Re: BFS Code in C# Or VB

Posted 21 April 2009 - 09:38 AM

Six, stop helping people here and write on your blog! Hahahahaha, just kidding. But seriously when are you gonna drop those 'mad skillz' so everyone can learn XNA?
Was This Post Helpful? 0
  • +
  • -

#7 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: BFS Code in C# Or VB

Posted 21 April 2009 - 11:20 AM

View Postpapuccino1, on 21 Apr, 2009 - 08:38 AM, said:

Six, stop helping people here and write on your blog! Hahahahaha, just kidding. But seriously when are you gonna drop those 'mad skillz' so everyone can learn XNA?


Started doing XNA tutorials, just posted one here on creating an Asteroids clone and just finished the code for my open source project tutorial. Having problems getting the HTML/CSS working. :P
Was This Post Helpful? 0
  • +
  • -

#8 nona  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-March 09

Re: BFS Code in C# Or VB

Posted 23 April 2009 - 11:49 PM

thanx alot for helping ...
six ...
the tutorial in console application....
and i need how to apply in windows application form in c#
i starting to do this with using your codz ..but in win.app.form...
thanx again...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1