Algorithm is a set of instructions for some specific task, that fulfills the following conditions: Some automate, fulfilling the algorithm up to the point, will solve the problem given in finite time (maybe, unknown beforehand). Algorithm can't contain any places that can be read in more than one ...
0
votes
1answer
15 views
2vs2 Poker Hand One Pair Winner Algorithm
I wrote this algorithm to determine the winning hand of two players going head to head with a hand of One Pair. Note that the hand is sorted once it is given out, and the algorithm has to compare the ...
0
votes
0answers
17 views
Multiplication Operation of Blocks - GCM. [closed]
I created a question on stack overflow for this. I guess this might be the place to have it posted instead. Please look at
http://stackoverflow.com/questions/10655026/gcm-multiplication-implementation
...
0
votes
0answers
80 views
OOP. Interfaces and Inheritance
I'm attempting to implement driver-layer from top-level app to hardware.
Driver is shared library.
Framework: Qt.
QDriverInterface class is
In the first, I extracted interface functions, which ...
2
votes
2answers
125 views
Calculating nth power of x
I have written the below code which precisely calculates the nth power of x by a recursive method.
I compared my program with java's pow(double, double) function, and most of the time I get ...
2
votes
2answers
99 views
Code review of Pouring water from code chef using Scala
I had posted this question on Stackoverflow and it seems like code review might be a better venue for my query. My question is as follows:
I am trying to solve the pouring water problem from codechef ...
1
vote
2answers
90 views
Find two equal substrings in a string
I have various strings that contain codes, e.g. like this:
"file = new JarFile(new File()" + "\nSystem.out.println(file"
but also
"args"
Now I want to find the substring that is in the beginning ...
0
votes
0answers
21 views
Optimizing this query based search
We have two N-bit numbers (0< N< 100000). We have to perform q queries (0< q<500000) over these numbers. The query can be of following three types:
set_a idx x: Set A[idx] to x, where 0 ...
3
votes
1answer
141 views
Java Code for permutations of a list of numbers
I asked this question on stackoverflow but someone directed me to this website. Please help.
I have written a program to find all the possible permutations of a given list of items. This precisely ...
2
votes
2answers
140 views
{Sum+=i++} to Reach N ( Code Optimization )
I am developing code for a problem posted on StackOverflow.
I have written my solution in Java but it is taking too much time to execute for numbers such as 21432154197846387216432. How could I ...
2
votes
3answers
82 views
How can you map the differences between Javascript objects?
The reason I want to do this is that the js objects are created from xml elements and if the element has changed I want to be able to detect that change in the js objects. So I wrote a function which ...
0
votes
0answers
15 views
How can you map the differences between Javascript objects? [closed]
Possible Duplicate:
How can you map the differences between Javascript objects?
The reason I want to do this is that the js objects are created from xml elements and if the element has ...
0
votes
0answers
95 views
Top-down Merge Sort in C++ [closed]
I made a top-down merge sort algorithm in c++ for array of characters.. This is based on the Top-down implementation of Merge sort from Wikipedia.
I also made a code generator for this algorithm, so ...
0
votes
0answers
67 views
Xbox 360 STFS File Manager in Python
This was meant to be a quick and dirty way for me to extract files from inside CON files for use in some online tools, but ended up taking about a week to complete. Never mind about the quick part ...
2
votes
2answers
82 views
Shuttle Puzzle: How can I Make This C++ Code Better
How can I make this piece of code better? The problem to be solved is in the top most comment.
#include <iostream>
#include <vector>
#include <cassert>
#include <stdint.h>
...
3
votes
4answers
114 views
Find most occurring word in a txt file
Assume that we have a .txt file that has one word per line.
Find out the word that occurs the most.
Here's what I was able to write (I used array of strings instead of a file in this example):
...