In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning.

learn more… | top users | synonyms (1)

1
vote
2answers
89 views

Algorithm Space and Time Complexity with Consideration for I/O (eg cache)

Is there an expression of performance for an algorithm or data structure that attempts to consider cache and other hardware concerns? Context: in my class we're looking at binary trees and it seems ...
2
votes
1answer
206 views

Efficient algorithm for Virtual Machine(VM) Consolidation in Cloud

PROBLEM: We have N physical machines(PMs) each with ram Ri, cpu Ci and a set of currently scheduled VMs each with ram requirement ri and ci respectively Moving(Migrating) any VM from one PM to ...
1
vote
0answers
24 views

Image segmentation - show or hide clusters

I'm trying to make a small program in c#, that will downsample image to specified amount of colors (using K-means). Then, user will be able to hide\show colored areas(clusters) in image. I've ...
3
votes
1answer
147 views

How to draw rectangles for 2D arrays

I have an 2D boolean array that looks like this: [0][0][0][0][0][0][0][0][0][0] [0][0][0][0][0][0][0][0][0][0] [0][0][0][0][0][0][0][0][0][0] [0][0][0][1][1][1][0][0][0][0] ...
-4
votes
0answers
59 views

Programming Concepts [on hold]

Can someone tell me the all the programming concept to be an expert programmer ? like Delegation, Classes etc.. any good books to learn those all the programming concepts that i can go from beginner ...
1
vote
1answer
51 views

Non-fixed-size Fenwick Tree implementation

I'm planning to implement a non-fixed-size Fenwick tree. That is, a Fenwick tree that allows interleaving range queries with adding/removing elements. All implementations and samples I've seen so far ...
2
votes
4answers
738 views

Finding the shortest path through a digraph that visits all nodes

I am trying to find the shortest possible path that visits every node through a graph (a node may be visited more than once, the solution may pick any node as the starting node.). The graph is ...
-6
votes
1answer
56 views

in c programming i need custom atoi code [on hold]

i want to subtract two 64 bit hex numbers(in c programming), 0x0000888888888888 -1st hex value - 0x00000000839DDB7A -2nd hex value = 0x0000888804EAAD0E =(need the above result in hex) The 1st ...
0
votes
1answer
51 views

How to search for patterns on a (game)board?

Assume a gameboard with two kinds of pieces. Let the task be to find a common patterns of pieces, namely the patterns that lead to winning. The problem is general, but the game in question is ...
2
votes
1answer
171 views

When designing a data structure, should I implement very inefficient operations for convenience?

(I've added the .NET tags because the data structures are for .NET, and this question should be considered in the context of the conventions for that platform.) I'm writing a library of immutable and ...
3
votes
1answer
72 views

Merge directed acyclic graphs minimizing number of nodes

I have some DAGs (directed acylic graphs) and I want to merge them in order to minimize the number of nodes (we could say that every node has a cost, while edges are free). These four different DAGs ...
-2
votes
1answer
41 views

Recursion and dynamic programming for maximization function [closed]

Player A and player B are given an array of size n. Each cell contains a positive integer, or 0. A and B take turns as given: Player A keeps either the first or the last cell, then player B keeps the ...
0
votes
2answers
89 views

Add file paths to database

I am scanning a directory of files and want to add them to a database. I have two variants: for file in walk(basedir): files.append(file) for file in files: add_to_database(file) versus ...
-6
votes
0answers
34 views

Spoj Trie Problem [closed]

Recently I've tried to solve a problem of SPOj. After submitting the solution it is giving me WA. :( I've tried with some cases and every input is giving me correct answer. But as the online judge ...
4
votes
3answers
131 views

Algorithm that generates a group of men and women who are each interested in everyone from the other gender

In my dating app, I need to compile lists of men and women where all of the men in the list are potentially interested in all of the women in the list, and vice versa. That is, in a list of 10 men ...
-3
votes
0answers
22 views

How Layered Voice Analisis Works? [on hold]

This voice analysis technology has lots of applications, but the available versions are expensive and are oriented to security and businesses. I am interested in developing an open source version of a ...
3
votes
2answers
181 views

How to iterate through all permutations of valid links between nodes

Imagine a 2D area, with a number (array) of nodes (or points) defined within it, in arbitrary (but known) positions (integer x,y coordinates), like this: From there I want to be able to, ...
-1
votes
0answers
42 views

Find value which fits into range [closed]

I have a five million data range which contains uint values. I need to find a number that fits inside of a specific range. The ranges do not overlap. I am searching for an algorithm that is able to ...
1
vote
2answers
95 views

Efficient datastructure to create size-limited dictionary

I need a class that acts like a dictionary but will constrain the total number of key/value pairs it contains. For instants, let's say the maximum number of entries is 1000 and the class already ...
2
votes
5answers
5k views

Is Bubble Sort the slowest sorting algorithm? [closed]

Is bubble sort the least Big-O efficient? If the answer is no, then what is the least efficient sorting algorithm?
3
votes
3answers
501 views

How to model state of leaving/entering home

I have two sensors: One detecting if the door is open or closed, another if movement has been detected in the corridor. I want to detect if the person has left or entered home. Usually the person has ...
-1
votes
0answers
48 views

Algorithm for triangulating a polygon with given boundary edges [on hold]

I am looking for an algorithm for triangulating a polygon with given points on the boundary and points in the interior. (This step has to be performed at the end of every iteration of an algorithm ...
0
votes
1answer
104 views

What algorithm can be used to determine order given incomplete information?

Given a series of statements such as: a<c a<b b<c (Read as "a is before b", "a is before c", etc.) What is the order of the elements? In this example, the answer is a<b<c. A less ...
1
vote
5answers
3k views

Algorithm for matching similar content text items

I am working on a website (C#, ASP.Net MVC 3) which reads some RSS feeds from multiple sources and put feed title and summary in a database table(Sql Server). What I want to do is: Put an algorithm ...
-1
votes
0answers
50 views

What is the best algorithm for real-time routing? [on hold]

I am trying to do optimal path vehicle routing but I read somewhere that Djikstra's algorithm has to be modified in order to route optimally in real-time. Is there any other algorithm that is ...
3
votes
5answers
423 views

Algorithm for a UI showing X percentage sliders whose linked values always total 100%

A system I'm building includes a set of UI sliders (the number varies) each with a scale of 0-100. By slider I mean a UI where you grab an element and drag it up and down, like a volume control. They ...
0
votes
2answers
175 views

What machine learning algorithm should I use to build an intelligent reminder? [closed]

I'm trying to build an intelligent reminder application for the mobile platform. I'm new to this and I'm kind of lost. So here's the problem... The application must behave like a personal assistant ...
-2
votes
1answer
56 views

Find the best shuffle

I am trying to solve the following problem: Question Description: Given four integer numbers A, B, C, and D, a shuffle of them is a zero-index array, which consists of these four numbers in some ...
0
votes
1answer
47 views

How to create good positive and negative images for opencv to distinguish smiling from not smiling? [closed]

My goal is to create an opencv haar classifier xml that distinguishes between me smiling and not smiling. I created images, cut them, showing me smiling and as negatives not smiling. About 5000 ...
-2
votes
2answers
82 views

Counting digits of a decimal number

Is there an algorithm to count digits of a decimal number other than saving it as a string and then looping to find the decimal point and thus count the digits?
0
votes
0answers
53 views

Algorithm for the Simplication and Evaluation of Equations

As a new programmer messing around in python, I've been playing about with writing small programs which can calculate some of the stuff I did in maths at school. I've been trying to think of a way ...
0
votes
2answers
289 views

How are the tiles in WORDAMENT organized?

I'm trying to create a word game, just like WORDAMENT, in my spare time. In order to present a new round, I need to create a board with 16 letters organized in a 4*4 grid. Currently, I'm generating ...
1
vote
1answer
77 views

More efficient alternative that checks if a list can be made a palindrome

I asked this question on Stackoverflow, but they told me this is the best place to ask. For my algorithms and data structures class, I have to write an algorithm that is more efficient in the worst ...
0
votes
1answer
83 views

What's the algorithm should I use for seeing how well 2 strings match?

Suppose I have 2 strings: string1 = "home/lisa/Music/some_files/01.05 - Garden Ground.mp3" string2 = "Music/Jim Smith/Unknown/(Deluxe Version/Garden Ground).mp3" string4 = "Music/Jim Smith/Unknown/00 ...
5
votes
1answer
98 views

Compute Adjacent Pair

I was asked the following question as part of an interview: Integer V lies strictly between integers U and W if U < V < W or if U > V > W. A non-empty zero-indexed array A consisting of ...
0
votes
1answer
52 views

Measure and locate areas of similar value in an image

I saw this picture online and wanted to see if I could create an algorithm to give ordinary images an effect like this: http://justinlivi.net/wp-content/uploads/2011/01/Living_In_Digital.jpg My idea ...
2
votes
2answers
189 views

String Searching algorithm

A title for a movie can be ambiguous. (Eg. The Lord of the Rings, Lord of the Rings, Lord of the Rings, The) There exists a database entry that has a list of movie titles mapped to a unique ...
7
votes
1answer
298 views

How do personal assistants typically generate sentences?

This is sort of a follow up to this question about NLG research directions in the linguistics field. How do personal assistant tools such as Siri, Google Now, or Cortana perform Natural Language ...
-1
votes
1answer
89 views

How to selecting Teams with Minimum Difference between Knowledge Levels

For the below challenge from a programming site, I am bit confused. Problem Statement: A Professor of Physics gave projects to the students of his class. The students have to form a team of two for ...
0
votes
1answer
98 views

Best algorithm for “ACM ICPC Team”

I have this problem (complete description): There is a list of persons N and M topics. I have to find out the maximum number of topics a 2-person team can know. And also find out how many teams can ...
0
votes
1answer
93 views

Dynamic Programming Problem - To find smallest integer number 'x' which contains only digits 1's and 0's such that x mod n = 0

To design an algorithm that will output the smallest integer number 'x' which contains only digits 1's and 0's such that x mod n = 0 and x > 0..... For example: 2 divides 10 3 divides 111 4 ...
0
votes
1answer
54 views

How to determine whether two trees (not necessarily binary) are isomorphic

Two ordered trees T' and T'' are said to be isomorphic if one of the following holds: ◦ both T' and T'' consist of a single node ◦ both T' and T'' have the same number k of subtrees, and the ith ...
0
votes
1answer
274 views

How can I rank teams based off of head to head wins/losses

I'm trying to write an algorithm (specifically in Ruby) that will rank teams based on their record against each other. If a team A and team B have won the same amount of games against each other, then ...
0
votes
0answers
44 views

All clustering possibilities for a graph

Is there a known algorithm for finding all clustering possibilities for a directed graph? EDIT: By cluster i mean a weakly connected sub-graph G, so that E(G) > 0. By a clustering possibility I ...
0
votes
1answer
136 views

Program to look at the first say 5 characters of a word and return a string if that string is actually the first 5 characters of a word?

For example, say I have a string and it has the letters: RDNAL This is not an actual English word or it doesn't start an actual english word, so the program would skip this string and would avoid ...
2
votes
1answer
93 views

Need an algorithm to filter this collection format

I'm sorry the title is so vague ... I cannot think how to describe it any better. I have a collection in this format: var myCollection = [{id:"a"}, {id:"b",excludes:["a"]}, {id:"c",excludes:["b"]}]; ...
3
votes
1answer
191 views

How can I approach creating an efficient algorithm for maximizing value with these specific constraints?

I'm having trouble coming up with an approach that isn't n^2 for this problem. Here's a contrived, simplified version I've come up with: Let's say you're a company that needs 4 employees to launch in ...
0
votes
1answer
86 views

Line intersection detection algorithm

I'm trying to detect if a line drawn by the user intersects itself. I'm using a line intersection detection algorithm that goes through each waypoint of the line and checks if intersects with any ...
2
votes
0answers
204 views

What algorithm is this?

I have some vague recollections from my algorithms courses, but nothing specific comes to mind. let S be a multiset of things we are interested in. As input, we get T, s1, s2, ... sn, all of which ...
0
votes
1answer
284 views

Calculate reachability of one point from another

I have an array which stores a set of positive x coordinates in sorted way, say arr={1, 4, 5, 9, 12, 45} etc. And I have a maximum distance k which I can go from one point to another point let ...