tagged [algorithm]

.NET Geometry Library

.NET Geometry Library Does anyone know of a good (efficient, nice API, etc.) geometry open source library for .NET? Some of the operations needed: - - `float``double`- - - - - `float``double`- - -

17 Apr at 20:59

Calculate median in c#

Calculate median in c# I need to write function that will accept array of decimals and it will find the median. Is there a function in the .net Math library?

8 Feb at 05:49

sorting integers in order lowest to highest java

sorting integers in order lowest to highest java These numbers are stored in the same integer variable. How would I go about sorting the integers in order lowest to highest?

26 Oct at 19:51

How do I figure out the least number of characters to create a palindrome?

How do I figure out the least number of characters to create a palindrome? Given a string, figure out how many characters minimum are needed to make the word a palindrome. Examples:

18 Oct at 17:18

How can I generate truly (not pseudo) random numbers with C#?

How can I generate truly (not pseudo) random numbers with C#? I know that the Random class can generate pseudo-random numbers but is there a way to generate truly random numbers?

5 Aug at 16:0

How to prove that a problem is NP complete?

How to prove that a problem is NP complete? I have problem with scheduling. I need to prove that the problem is NP complete. What can be the methods to prove it NP complete?

27 Nov at 22:30

Find if point lies on line segment

Find if point lies on line segment I have line segment defined by these two points: and . I have point . How can I check if the point lies on the line segment?

8 Apr at 22:23

How to implement a queue using two stacks?

How to implement a queue using two stacks? Suppose we have two stacks and no other temporary variable. Is to possible to "construct" a queue data structure using only the two stacks?

23 Aug at 00:59

Sum of digits in C#

Sum of digits in C# What's the fastest and easiest to read implementation of calculating the sum of digits? I.e. Given the number: 17463 = 1 + 7 + 4 + 6 + 3 = 21

26 Jan at 06:18

Polynomial time and exponential time

Polynomial time and exponential time Could someone explain the difference between polynomial-time, non-polynomial-time, and exponential-time algorithms? For example, if an algorithm takes O(n^2) time,...

22 Mar at 16:22

shuffle (rearrange randomly) a List<string>

shuffle (rearrange randomly) a List I need to rearrange my List array, it has a non-determinable number of elements in it. Can somebody give me example of how i do this, thanks

21 Mar at 20:48

Which is the fastest algorithm to find prime numbers?

Which is the fastest algorithm to find prime numbers? Which is the fastest algorithm to find out prime numbers using C++? I have used sieve's algorithm but I still want it to be faster!

15 Sep at 13:56

Breadth First Vs Depth First

Breadth First Vs Depth First When Traversing a Tree/Graph what is the difference between Breadth First and Depth first? Any coding or pseudocode examples would be great.

What is Sliding Window Algorithm? Examples?

What is Sliding Window Algorithm? Examples? While solving a geometry problem, I came across an approach called Sliding Window Algorithm. Couldn't really find any study material/details on it. What is ...

20 Oct at 14:42

Facial recognition/merging software

Facial recognition/merging software Can anyone point me in the right direction of some facial recognition libraries & algorithms ? I've tried searching/googling but i mostly find thesises and very lit...

16 Feb at 12:34

How do I calculate a point on a circle’s circumference?

How do I calculate a point on a circle’s circumference? How can the following function be implemented in various languages? Calculate the `(x,y)` point on the circumference of a circle, given input va...

14 Apr at 02:33

How is a random number generated at runtime?

How is a random number generated at runtime? Since computers cannot pick random numbers(can they?) how is this random number actually generated. For example in C# we say, What happens inside?

Shortest code to calculate list min/max in .NET

Shortest code to calculate list min/max in .NET I'd like something like Is there a builtin way to do this in .NET?

30 Oct at 15:17

Calculate Time Remaining

Calculate Time Remaining What's a good algorithm for determining the remaining time for something to complete? I know how many total lines there are, and how many have completed already, how should I ...

23 Jan at 15:43

Expand a random range from 1–5 to 1–7

Expand a random range from 1–5 to 1–7 Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.

17 Jul at 05:1

How do I check if a number is a palindrome?

How do I check if a number is a palindrome? How do I check if a number is a palindrome? Any language. Any algorithm. (except the algorithm of making the number a string and then reversing the string).

2 Nov at 22:36

Best sorting algorithms for C# / .NET in different scenarios

Best sorting algorithms for C# / .NET in different scenarios What are the best algorithms for sorting data in C#? Is there one sorting algorithm that can handle 80% of sorts well? Please give code ex...

4 Nov at 16:47

Is there any algorithm in c# to singularize - pluralize a word?

Is there any algorithm in c# to singularize - pluralize a word? Is there any algorithm in c# to singularize - pluralize a word (in english) or does exist a .net library to do this (may be also in diff...

31 Jan at 16:52

Performing Breadth First Search recursively

Performing Breadth First Search recursively Let's say you wanted to implement a breadth-first search of a binary tree . How would you go about it? Is it possible using only the call-stack as auxiliary...

1 Nov at 15:32

Examples of Algorithms which has O(1), O(n log n) and O(log n) complexities

Examples of Algorithms which has O(1), O(n log n) and O(log n) complexities What are some algorithms which we use daily that has O(1), O(n log n) and O(log n) complexities?

2 Jan at 20:20