Tagged Questions
8
votes
5answers
819 views
Efficient pathfinding without heuristics?
Part of my program is a variable-sized set of Star Systems randomly linked by Warp Points. I have an A* algorithm working rather well in the grid, but the random warp point links mean that even though ...
2
votes
1answer
199 views
What is this structure called?
I've been writing this data structure for a few days, and now I'm really curious about what it actually is, and to get some critique on my logic.
A branch, based on this usage, exists when a ...
5
votes
2answers
268 views
Can I simplify this recursive grid search?
I've written a recursive method for fetching grid neighbours in a symmetrical 2-dimensional grid, the problem is that I've found myself duplicating the code more or less into an overload to prevent my ...
2
votes
2answers
72 views
Recursive function for listing directories [closed]
The below code is recursive function that list directories in 2 levels:
...
7
votes
1answer
358 views
Web service proxy that switches endpoint URLs in the event of a TimeoutException
I am creating a service (FaultTolerantCommunication) that wraps a call to a (web) service. Its responsibility is to switch the endpoint URL in the event of a ...
2
votes
2answers
449 views
Merge Sort Implementation
Any reviews/ways to speed up/general improvements for my Merge Sort? Maybe something to simplify it or add more to it?
...
3
votes
2answers
121 views
Simple file recurser
I'm using C# for a project and thought I would get a feel for the language by making some simple programs. My current program is a simple file recurser that prints the names of files and directories. ...
4
votes
3answers
4k views
Recursive method turning flat structure to recursive
I often end up working with systems where the data is delivered with some Id property and possibly a parentId prop, but never do ...
5
votes
2answers
230 views
3
votes
1answer
794 views
Make a recursive method faster
How would you refactor this method to make it more performant?
If you have refactored the code you need to prove the performance gain in numbers to get the solution :)
...
3
votes
2answers
1k views
Is this Recursion + Linq example inefficient?
I have a hierarchy of of groups, and I want to get a collection of all the lowest level groups (or leaves if we'll look at this as a tree).
I wrote the following code. Is it inefficient?
...
1
vote
1answer
171 views
Implement recursion
The rules for this program are to:
Generate n X n grid.
Arbitrarily pick a point and grow a 'shape' based off that initial point.
Must have at least 3 points.
Strongly biased to not completely fill ...
9
votes
3answers
318 views
Recursive Fibonacci with Generic delegates
Here is fast recursive fibonacci like for loop. How it be more readable and is possible remove TArg's ?
...
6
votes
2answers
589 views
14
votes
4answers
1k views
Displaying each number of an integer in a sequence
One of the books I'm currently reading to learn C# asked me to write a method that takes an integer between 1 and 99999 and displays each number in that integer in a sequence, separating each digit by ...
3
votes
2answers
181 views
Custom UI - Seeing which control has focus
I'm trying to make a simple UI to better understand how interfaces and the System.Windows.Forms Controls behave.
Like the above namespace, I will be able to get ...
1
vote
0answers
358 views
How to optimize this maze solver?
I've written C# code for solving a maze problem. It works, but I want to optimize it so that it could give me all paths. To solve the maze, I walk on the zeros and assumed that the final is reaching ...
11
votes
4answers
5k views
Any way to make this recursive function better/faster?
Is there anything that can be done differently for this function? Any way to make it faster?
...
3
votes
3answers
140 views
String Extension improvement
I am creating a string extension to validate some input.
My scenario is when we have a string it will format it according to following guideline.
If the sample string is “One Two Three Four Five” and ...
1
vote
1answer
183 views
Checking user permission, where permission is granted for specific EmployeeGroup that has self reference
The users get permissions to do specific things for a specific group of employees. These employee groups have a self reference. So an employee group (C) can be a child of group (B), and group (B) is ...
2
votes
2answers
73 views
Optimizing odds calculator
I am trying to setup an odds calculator for a best of 7 series, given independent odds for each event.
The following code works, but I would like to add recursion to simplify the end.
...
0
votes
2answers
107 views
Code optimization for euler's problem 28
I have found the solution for euler's problem using recursion.Is it okay or is there any other way to optimize the code?
...
3
votes
2answers
176 views
JQuery typed wrapper in C#; possible recursion
I am writing an object in C# to mimic jQuery's various functions. That is, calling the constructor is akin to calling the $() function of jQuery. For example,
...
-2
votes
1answer
101 views
recursive function [closed]
I want to generate a random number then to check if it is in the database. If not then redo it.
My pseudo code:
...
2
votes
4answers
480 views
How can I remove unwanted combinations from my algorithm in C#?
I have written an algorithm in C#. It is recursive, but it is not optimal. Maybe you have suggestions for improvement? (I already posted this question on stackoverflow but the question was closed ...
1
vote
2answers
668 views
Need a method that recursively finds all objects of type System.Web.UI.Pair in an object array
I have an object array that contains various types of objects (primitives, strings, other object arrays) at arbitrary levels of nesting. I need to pull all objects of type ...