I have written a basic linked list class in C#. It has a Node object, which (obviously) represents every node in the list.
The code does not use IEnumerable, however, I can implement a sorting function? The language I am using is C#. Is there an example of this in C#?
I am working from this sample: http://www.c-sharpcorner.com/UploadFi...
I am working on a program where I want to be able to add functionality using DI, C#, so I will create an example to see if this is possible.
I have a program that a user enters any two numbers.
The program then looks at all the plugins in an xml file and uses those classes that are injected to calculate with these two numbers.
So, I cr...
I'm combing a webapp's log file for statements that stand out.
Most of the lines are similar and uninteresting. I'd pass them through Unix uniq, however that filters nothing, as all the lines are slightly different: they all have a different timestamp, similar statements might print a different user ID, etc.
What's a way and/or tool to...
I'm working on a homework assignment and as a "hint" we are told to find the following algorithm, and then prove it to the necessary answer.
Let L(1), L(2), .., L(k) be sorted lists of n elements each. Give a O(kn logk) space algorithm that supports the O(log n + t) Locate operation, which returns the location of t items.
Ideally, I wi...
Imagine a value, say '1234'. I want to map that value to an other value, say 'abcd'. The constrains:
The length of the target value is equal to the start value
The mapping should be unique. E.g. 1234 should only map to abcd and viseversa
The mapping process should be (very) difficult to guess. E.g. multiplying by 2 does count
The mapp...
I need to sort the nodes of a directed graph such that the number of arrows that flow backwards (against the sorting order) is minimal.
I can think of algorithms (e.g. keep swapping nodes until no swap will improve things) but I'm not sure how fast they run or whether they arrive at the best solution.
What is the name and complexity of...
I want to draw some data into a texture: many items in a row. They aren't created in order, and they may all be different sizes (think of a memory heap). Each data item is a small rectangle and I want to be able to distinguish them apart, so I'd like each of them to have a unique colour.
Now I could just use rand() to generate RGB value...
What is the fastest known sort algorithm for absolute worst case? I don't care about best case and am assuming a gigantic data set if that even matters.
...
Is there any information as to how SQL Server compares strings and handles searching in them (like statments)? I am trying to find out if there is a way to determine how efficient it is to store information as a large string and use sql server to do a bunch of comparisons on rows to determine which match. I know this is potentially goi...
** READ BEFORE POSTING **
I am aware of the multiply and add solution but since these are arbitrary length numbers, the multiply and add operations are not free so I'd like to avoid them, if at all possible.
My challenge is this: I want to be able to take, as input, a character pointer to a number in base 2 through 16 and as a second p...
Under IPv4 I have been parsing the string representation of IP addresses to Int32's and storing them as int's in SQL Server.
Now with IPv6 I'm trying to find out if there's a standard or accepted way to parse the string representation of IPv6 to two Int64's using C#? Also how are people storing those values in SQL Server? As 2 fields of...
Could you recommend a good book on C# algorithms and data structures? I am looking for something that is intermediary to advanced as a difficulty level. Java would also be acceptable, but I would prefer a book on C#.
...
I have been working with some friends to convert a Matlab Genetic Algorithm to C++ and it works in a sequential order currently. Matlab is no longer a portion of our current code.
We are looking to use it on a cluster, but have been a little dry on resources. We have a cluster available at the University and it is equipped with Rocks ...
Put simply a Soundex Algorithm changes a series of characters into a code. Characters that produce the same Soundex code are said to sound the same.
The code is 4 characters wide
The first character of the code is always the first character of the word
Each character in the alphabet belongs in a particular group (at least in this exa...
Looking at the implementation on Wikipedia, it would seem that a standard BST (non self balancing) never re-arranges itself during inserts, and so the very first item added will always be the root. Is this correct? If so, doesn't that mean that there is the potential for a BST to often have much worse than O(logN)?
Using this as a refer...
I'm familiar with the algorithm for reading a single random line from a file without reading the whole file into memory. I wonder if this technique can be extended to N random lines?
The use case is for a password generator which concatenates N random words pulled out of a dictionary file, one word per line (like /usr/share/dict/words)...
I am running into a road block on a larger problem.
As part of a large query I need to solve a "night watchman" problem.
I have a table with schedule shifts as such:
ID | Start | End
1 | 2009-1-1 06:00 | 2009-1-1 14:00
2 | 2009-1-1 10:00 | 2009-1-1 18:00
3 | 2009-2-1 20:00 | 2009-2-2 04:00
4 | 2009-2-2 06:00 | 2009-2-2 14:...
Give a linear-time algorithm to test whether a tree has a perfect matching,
that is, a set of edges that touches each vertext of the tree exactly once.
This is from Algorithms by S. Dasgupta, and I just can't seem to nail this problem down. I know I need to use a greedy approach in some manner, but I just can't figure this out. Help?...
I'm looking for an efficient algorithm for scrambling a set of letters into a permutation containing the maximum number of words.
For example, say I am given the list of letters: {e, e, h, r, s, t}. I need to order them in such a way as to contain the maximum number of words. If I order those letters into "theres", it contain the words ...
How does Google News and Techmeme cluster news items that are similar? Are there any well know algorithm that is used to achieve this?
Appreciate your help.
Thanks in advance.
...