We have three sets S1, S2, S3. I need to find x,y,z such that
x E S1
y E S2
z E S3
let min denote the minimum value out of x,y,z
let max denote the maximum value out of x,y,z
The range denoted by max-min should be the MINIMUM possible value
...
This is a difficult question to search in Google since it has other meaning in finance.
Of course, what I mean here is "Drawing" as in .. computer graphics.. not money..
I am interested in preventing overdrawing for both 3D Drawing and 2D Drawing.
(should I make them into two different questions?)
I realize that this might be a very b...
The Levenshtein distance gives us a way to calculate the distance between two similar strings in terms of disordered individual characters:
quick brown fox
quikc brown fax
The Levenshtein distance = 3.
What is a similar algorithm for the distance between two strings with similar subsequences?
For example, in
quickbrownfox
brownqui...
I understand what Dijkstra's algorithm is but I don't understand why it works.
When selecting the next vertex to examine, why does Dijkstra's algorithm select the one with the smallest weight? Why not just select a vertex arbitrarily, since the algorithm visits all vertices anyway?
...
In my app, the GPS picks the location of the vehicle. It is then supposed to put markers at all points where the vehicle could be if it drives for 1 KM in any direction (note that the roads may fork many times within his 1KM reach).
Can someone suggest me how to do this? Thanks in advance.
...
Suppose I have a list of strings where each string is
exactly 4 characters long and
unique within the list.
For each of these strings I want to identify the position of the characters within the string that make the string unique.
So for a list of three strings
abcd
abcc
bbcb
For the first string I want to identify the character ...
What is your advice on:
compensation of accumulated error in bulk math operations on collections of Money objects. How is this implemented in your production code for your locale?
theory behind rounding in accountancy.
any literature on topic.
I currently read Fowler. He mentions Money type, it's typcal structure (int, long, BigDecim...
I need make a merge sort using an additional array. Here is my code:
public class extra_storage{
public static void main(String[]args) {
int x[]=new int[]{12,9,4,99,120,1,3,10};
int a[]=new int[x.length];
mergesort(x,0,x.length-1,a);
for (int i=0;i<x.length;i++){
System.out.println(x[...
I'm programming a function for a TI-NSpire, so I can't use the builtins from inside a function. What is the most generally efficient algorithm for sorting a list of numbers without modifying the list itself? (recursion and list-splitting are fair game, as is general use of math.)
...
ok so I am feeling a little stupid for not knowing this, but a coworker asked so I am asking here: I have written a python algorithm that solves his problem. given x > 0 add all numbers together from 1 to x.
def intsum(x):
if x > 0:
return x + intsum(x - 1)
else:
return 0
intsum(10)
55
first what is this type of equation ...
I would like to implement a simple substitution cypher to mask private ids in URLs
I know how my IDs will look like (combination of upperchase ascii, digits and underscore), and they will be rather long, as they are composed keys. I would like to use a longer alphabet to shorten the resulting codes (I'd like to use upper and lower case ...
hi i need to write sucj kind of sorting maybe it is similary to radix sort
and also (this is not homework because i created it problem myself and please if anobody can help me) problem is like this
suppose i have array int x[]=new int[]{4,5,3,2,1};
let write it into binary form
5 -0101
4- 0100
3-0011
2-0010
1-0001
i want to sort...
I have two float arrays representing y values in a line chart. Now I want to align these two charts. Are there any existing algorithms for alignment of the two arrays?
A very simple example
a:
2.5 1.3 1.6 4.2 3.6
b:
3.3 1.4 2.5 1.3 1.6
Now after alignment it should be:
2.5 1.3 1.6 4.2 3.6
3.3 1.4 2.5 1.3 1.6
In reality it...
I got a problem which I do not know how to solve:
I have a set of sets A = {A_1, A_2, ..., A_n} and I have a set B.
The target now is to remove as few elements as possible from B (creating B'), such that, after removing the elements for all 1 <= i <= n, A_i is not a subset of B'.
For example, if we have A_1 = {1,2}, A_2 = {1,3,4}, A_3...
I believe, there is an algorithm, which can equal two strings with similar typefaces of a characters, but different symbols (digits, Cyrillic, Latin or other alphabets). For example:
"hello" (Latin symbols) equals to "he11o" (digits and Latin symbols)
"HELLO" (Latin symbols) equals to "НЕLLО" (Cyrillic and Latin symbols)
"really" (Lati...
I have a mesh defined by 4 points in 3D space. I need an algorithm which will subdivide that mesh into subdivisions of an arbitrary horizontal and vertical size. If the subdivision size isn't an exact divisor of the mesh size, the edge pieces will be smaller.
All of the subdivision algorithms I've found only subdivide meshes into exact ...
Hi there,
a collegue of mine proposed to me an exercise from an online judge website, which is basically a graph solving problem of an evacuation plan on a small town.
i dont need the answer (nor do i want it) i just need an advice on which is the best approach to solving it since im kinda new to these kind of problems.
the problem co...
Hello :)
This is for an assignment, and is in psuedo-code.
I need to find how many integers in an array are unique, nothing else, but it has to be in O(n), preferably without hashing.
Thanks!
...
I would like to generate a long UUID - something like the session key used by gmail. It should be at least 256 chars and no more than 512. It can contain all alpha-numeric chars and a few special chars (the ones below the function keys on the keyboard). Has this been done already or is there a sample out there?
C++ or C#
Update: A GUI...
Hello,
I am trying to understand what is a chain matrix multiplication and how it is different from a regular multiplication. I have checked several sourcers yet all seem to be very academically explained for me to understand.
I guess it is a form of dynamic programming algorithm to achieve the operation in an optimised way but I didn'...