An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.

learn more… | top users | synonyms (2)

0
votes
1answer
17 views

Compiling error: Login and Menu

So im getting a compiling error that says: 12 C:\Dev-Cpp\login.cpp expected unqualified-id before "while" 12 C:\Dev-Cpp\login.cpp expected ,' or;' before "while" C:\Dev-Cpp\Makefile.win [Build ...
0
votes
0answers
5 views

Finding Matches in Stata

I have 22,000 entries, each with a unique ID (ID), and 6 variables A B C D E F as well as an entry creation date (DATE). Entries can be of either type 1 (if E == 1) or type 2 (if E == 0). What is the ...
-4
votes
1answer
23 views

Where can I get the convex hull algo? with complete details?

Where can I find "Convex-hull" algorithm? with it's input, output, running time analysis and etc. I can't seem to find it. please really need it
3
votes
3answers
60 views

find the length of any arc on a circle

I have an interesting (to me anyway) problem. I am working on OpenServo.org for V4 and I am trying to determine the length of an arc of travel and its direction. I have a magnetic encoder that ...
0
votes
2answers
15 views

Can someone explain why f(n) + o(f(n)) = theta(f(n))?

According to this page: The statement: f(n) + o(f(n)) = theta(f(n)) appears to be true. Where: o = little-O, theta = big theta This does not make intuitive sense to me. We know that o(f(n)) ...
0
votes
1answer
54 views

Choosing sorting algorithm for system of winning & losing

I have a bunch of elements which have been compared to some other elements and either win or lose. There is not full data e.g. all elements compared to all other elements. Instead I have a list like ...
-5
votes
1answer
34 views

Shortest path using php [on hold]

i have an array of coordinates in php like this: Array ( [0] => Array ( [0] => 39.1057579 [1] => 26.5451331 ) [1] => Array ( [0] => 39.1057579 ...
6
votes
7answers
96 views

Given a string of numbers and a number of multiplication operators, what is the highest number one can calculate?

This was an interview question I had and I was embarrassingly pretty stumped by it. Wanted to know if anyone could think up an answer to it and provide the big O notation for it. Question: Given a ...
1
vote
3answers
54 views

Minimum value of numbers in char array

I recently ran into this problem in an interview, and I was curious what the best way to solve it would be. The question is given a char array that has the ascii characters '0' to '9' make one swap ...
-1
votes
0answers
33 views

Analyze my subtree algorithm?

I'm trying to implement a function in Ruby to check if binary tree2 is a subtree of binary tree1. This is what I have so far -- it seems to work, but I'm not sure how scalable it is. Is this O(2^k) ...
0
votes
1answer
60 views

Developing a linear time algorithm to traverse a graph

I'm going through an algorithms textbook to improve my algorithm skills but I'm completely stuck on this question and it's bugging me. I think the underlying data structure is a graph but I don't even ...
-3
votes
1answer
42 views

appropriate sorting algorithm

I am a little unsure of my answer to the question below. Please help: Suppose you are given a list of N integers. All but one of the integers are sorted in numerical order. Identify a sorting ...
-1
votes
0answers
51 views

Java dice probability [on hold]

I'm working on a java program and I cant seem to figure out the right way to even approach this program. The program should simulate two separate dice (use random numbers with the appropriate range) ...
-3
votes
2answers
83 views

Approximation of PI

I'm trying to solve that product, in the following equation. The problem that I feel that is a recursive problem, but I don't know where is the base case? otherwise, should I simplify the square ...
0
votes
1answer
20 views

How can I group this list of elements using threads?

this is my first question here at Stackoverflow, so here it goes... I have a list like this: [Header/Element] [Element] [Element] [Header] [Element] [Element] [Element] [Header] [Element] ... ...

15 30 50 per page