Can someone please code me the CRC64 Reverse Algorithm in C#? I am unable to code it, can't understand anything. Thanks,
I have copied the CRC64 Checksum code from C++ and converted it into C# .NET. The entire code is displayed below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CRC64...
Hello,
Im trying to solve the flipping coins problem on codechef.com (http://www.codechef.com/problems/FLIPCOIN/)
My code is in C, and i tested it using gcc v4.4.3 on my machine running Linux,and my program works for the sample input provided. However, on uploading to the judge i get the message "Wrong Answer".
In my program i represent...
Say I have a set (or graph) which is partitioned into groups. I am interested to find the number of transitions between two partitions, where a transition involves taking an element out of one partition and moving it into another (or singleton partition by itself)
For example there is one transition between partitions
1 2 | 3 and 1 |...
I have implemented a basic page layout algorithm for footnote placement. Basically:
Layout a line of body text.
If it contains footnote references, lay out footnotes line by line.
Go to 1.
At every step, I check to see if the total height (body text + footnote text + gap) exceeds page height. If it does, I remove the most recently l...
I'm using ControllerMate with a Nostromo (Belkin) n52 (NOT the te version) Speedpad on an iMac running Snow Leopard.
The official SpeedPad configuration software doesn't run beyond Tiger, or at least, it doesn't run on Snow Leopard due to the kext failing to load properly, hence the attempt at using ControllerMate.
The official SpeedPa...
I tried working out the problem using Tarjan's Algorithm and one algorithm from the website: http://discuss.techinterview.org/default.asp?interview.11.532716.6, but none is clear. Maybe my recursion concepts are not build up properly. Please give small demonstration to explain the above two examples. I have an idea of Union Find data-str...
I'm writing a program which solves a 24-puzzle (5x5 grid) using two heuristic. The first uses how many blocks the incorrect place and the second uses the Manhattan distance between the blocks current place and desired place.
I have different functions in the program which use each heuristic with an A* and a greedy search and compares th...
Hello
I have the following two questions.
I'm aware of the concept of a linked
list. What is a linked list of
intervals?
I need to store a very huge (more than 100 bits) number in C/C++ and perform bitwise operations on it. Without using any big number library, what would be the best data structure to handle this scenario ?
Thank Yo...
As you know finding maximum independent set is NP. Is there an algorithm to find out whether a given graph has an Independent set of at least k vertices? Note that we don't want to find it. We just want to find out if such thing exists.
...
If I have a set of tags (<100), and a set of objects (~25000), where each object has some sub-set of the tags, do you know of an existing data-structure that would allow for fast retrieval of those objects that satisfy some boolean function of the tags?
Addition/deletion of tags and objects need not be particularly fast, but selection o...
I am trying to learn F#.
I wrote a function that factors out primes.
let PrimeFactors x =
let rec PrimeFactorsRecursive x div list =
if x % div = 0 then PrimeFactorsRecursive (x/div) div list @ [div]
elif div > int(System.Math.Sqrt(float(x))) then
if x > 1 then list @ [x]
else list
else PrimeFactorsRecur...
Can anyone please explain with the easy coding how to reverse this algorithm so that I get back the original text string?
Public Function CreateIntChecksum(ByVal s As String) As Integer
Dim r As Integer = 0
For i As Integer = 0 To (s.Length() - 1)
Dim bchar As Byte = Convert.ToByte(s(i))
r = bchar + ((r << 5) - r...
How would I code a reversible shuffle algorithm in C# which uses a key to shuffle and can be reversed to the original state?
For instance, I have a string: "Hello world", how can I shuffle it so that later I could be able to reverse the shuffled string back to "Hello world".
...
Give me some thoughts how to implement undo/redo functionality - like we have in text editors.
What algorithms should I use and what I may read. thanks.
...
Hi all
I started reading 'Introduction to Algorithms' today, but I've gotten a bit confused over one of the exercises.
Exercise 1.2.2 asks the reader
Suppose we are comparing implementations of Merge sort and Insertion Sort on the same
machine. For inputs of size n, insertion sort runs in 8n^2 steps,
while merge sort runs in...
I have binary array in c, I want to compress the array, kindly suggest me algorithm which compress binary array. I have used Lempel–Ziv–Welch (LZW) algorithm but its not suitable for me because there is no repetition in my data.
...
Hello, I'm trying to solve a problem (in php, but programming language doesn't matter).
I'm having a n number of persons that have paid money, and I have got a m number of persons that are going to pay the same amount as the sum of what the n number of people have paid.
I want to calculate the shortest route of money transfers between th...
I'm experimenting with particle swarm optimisation and am trying to determine the best approach for the following simple scenario:
Optimizing a 1-dimensional function (i.e. particles are moving along a single line)
The function to be optimised can be sampled at any point on the line
The "value" sampled for each position is very noisy
T...
How does the system perform the 2^56 modulo 7, if it's 32 bits operating system in cryptography for example?
And how it stored in memory?
...
I was having a look at this question and then reading about Tarjan's least common ancestors algorithm. I never came across any applications of LCA algorithms before.
Where are such LCA algorithms commonly used?
...