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
votes
0answers
22 views

Sorting a 2d array in java

I'm a high school student who is interested in computer science, I asked this question to my teacher but she told me not to bother messing around with code and trying to understand how to modify ...
0
votes
0answers
7 views

Coerce optBlock in AlgDesign R package to only show certain treatments per row of blocks

Using the optBlock function of the AlgDesing R package, I can create a block design with 16 treatments, 12 blocks (columns), and 4 treatment per block (rows) with the following code: optBlock(~.,...
1
vote
0answers
32 views

What are the methods to accurately test the accuracy of a parts of speech tagger?

I know that most of the pos tagger algorithms measure their accuracy token wise I.e. whether the token is tagged correctly or not Some pos taggers provide sentence accuracy too. How is sentence ...
1
vote
1answer
51 views

Choose “representative” subset out of a set of points

So I have a set of given locations (i.e. two-dimensional points) G, a set of wanted locations W and a natural number N. Assume |W| < N. I want to choose N elements of G such that the elements of ...
1
vote
1answer
59 views

Given an array of number, how to calculate to a target value

Chatting with a friend about a game we used to play, and thinking how to implement it in code. Here is the rules: Given a list of number e.g. {1,2,3,4} try to use all the number from the list to ...
0
votes
0answers
47 views

Converting dynamic webpage into static

I am working on a project in which I need to take a dynamic website like adobe spark - https://spark.adobe.com/gallery/gallery-editors-choice/example/maggie-to-monte/ and create a static html+css page ...
3
votes
1answer
164 views

Potential legal issues with lock-free / wait-free structures / algorithms

While researching the subject matter - lock-free and wait-free data structures - I'm seeing a worrying amount of mention of patents with this area. I've hobby-researched compression algorithms years ...
1
vote
1answer
43 views

Dynamic-programming matrix exercise

I'm practicing with dynamic programming and I'm trying to solve this exercise http://www.geeksforgeeks.org/collect-maximum-points-in-a-grid-using-two-traversals/ But I can't understand how to use ...
-1
votes
0answers
29 views

Profile user based on their read time for a news app [on hold]

I made a news aggregator app which has news in 5 categories. There is a main section in the app which shows news item from all categories and also menu shortcuts to filter and show individual ...
1
vote
0answers
49 views

String Pattern Matching from Lookup Table - Non-Exponential Solution?

Given the problem... Given a String comprising of non-alhpabetical symbols, and a Lookup Table where a subset of those symbols may equate to a single alphabetical character, output all ...
0
votes
0answers
39 views

Algorithm: Calculate average time in given time frame

I have a complex problem to solve. Problem Statement: I have a list of cities: Lets say New York, LA Las Vegas California The list of cities is limited, not more than 10. Now there are peoples ...
1
vote
0answers
21 views

Consistent hash ring with subsets in different buckets

I have N buckets. I have M users. Each user can buy anywhere between 1 and N tickets to an upcoming lottery. I would like to distribute the tickets more or less evenly between the buckets, with the ...
-3
votes
1answer
73 views

How to create artificial intelligence for rummy based game? [closed]

I'm creating a rummy based game for iPhone. I don't know how to implement AI algorithm or which algorithm to use. I want to know which algorithm suitable for rummy based game and how to implement?
0
votes
1answer
39 views

How does Pearson hashing compare with other non-cryptographic hashing algorithms?

FNV-1, Murmur2, and DJB2 are examples of non-cryptographic hashing functions used in actual applications (see programmers.stackexchange.com/questions/49550). These are all similar in that they have an ...
0
votes
0answers
20 views

efficient graph clustering algorithm for weighted directed graphs based on node and edge weights

I'm looking for an algorithm to cluster weighted directed graphs that have weights on both edges and vertices. I'm using graphs with multiple weights(labels) on vertices and a weight on edges that ...
0
votes
1answer
47 views

Hash system to generate same (specified) hash from multiple datasets?

I have a hashed value X and need to ensure that any of the data sets D1...Dn can be concatenated with a correctional value C1...Cn and passed into a hashing algorithm to result in the value of X. ...
0
votes
0answers
32 views

Best way to find longest common subsequence by hand without computer

I know how to solve the Longest common subsequence using a computer, but how would one do it without the use of one? I also know that I can use tables for help, but what if I get two strings of length ...
0
votes
1answer
101 views

Most efficient algorithm for getting the word frequencies in a stream of characters?

I have a dictionary of words and a stream of incoming characters. I need to create a map of words present in the stream along with their frequencies. How can I achieve this efficiently?
1
vote
2answers
115 views

How to find suppliers who can supply to me?

I am not able to search for algorithms which can help me solve this problem, I am not sure under which category this problem falls or which algorithm to use. Problem statement: There are N number of ...
-1
votes
1answer
90 views

How do I implement autocomplete functionality for a big website? [closed]

I am looking to implement a custom autocomplete functionality for a travel website with huge amounts of data. I am thinking of implementing it using a trie. But how do I handle it if the data cannot ...
0
votes
1answer
56 views

Complex Math Formula: Predict the value of variable if result is known

I have a very complex math formula/equation which involves exponential. Formula: X + 2 = Y *PS: The above is just an example to illustrate my problem. The real formula is way more complex than this....
0
votes
1answer
57 views

How to implement to flood fill algorithm on multiple machines?

I have a large image distributed over multiple machines for which I need to implement the flood fill algorithm used in MS Paint. I am able to do it with a single machine but what approach must be ...
-3
votes
0answers
96 views

Algorithm for resource allocatoin [closed]

I have an array like this: [1,3,6,7,3,6] Which shows that the first day there are 1 resource free, the second day 3 etc. I want to make an algorithm that returns something like for days 2-6 there ...
0
votes
1answer
75 views

Combine sequences of numbers with “variable bitlengths” into short unique strings

It is not unlikely that what I want to do is not possible, but it doesn't hurt to ask. Imagine a set of lists, each containing positive integers (in my case, a list always consists of four integers, ...
2
votes
2answers
87 views

Find next solution using backtracking algorithm

I won't explain what backtracking is, Wikipedia article does it well enough. Backtracking solver is usually implemented using recursive function that traverses a tree of potential candidates that is ...
0
votes
0answers
30 views

Optimal Simplification of Transposition Products

I am looking to take a product of a large number of transpositions, and boil it down to a smaller number of products. I have the following code, and would like some input on efficient ways to boil ...
2
votes
1answer
55 views

Pre-computation strategies when solving multiple linear equations with the same matrix?

Often in modeling, data processing, and optimization; the intensive portions of the code can often reduce to solving a lot of linear equations. e.g. solve for x1 in A x1 = b1 solve for x2 in A x2 =...
-2
votes
0answers
27 views

Word association with domain specific metadata

Let say , I have n number of domain and for each domain, i have separate text corpus. [ means text corpus specific to different market places[US/UK/JP...]] Now same word can appear in many different ...
0
votes
0answers
84 views

Planning dinner seating, having each person sit with as many other people as possible, changing tables between each course

My project is as follows: I am making a program for planning dinner seating that will take a number of courses, a number of tables, and a list of people. The goal is to have each person sit with as ...
1
vote
1answer
93 views

What Graph Theory approaches or algorithms are useful for designing a House?

I have a set of data about a family, and I want the software to find a house design that fits the data (which includes stuff like preferences and whether they want a pool. The current way I am going ...
0
votes
1answer
85 views

Brute force improvement over generating permutations?

I am trying to improve a brute force algorithm for letters of the English alphabet [a-z][A-Z] and numbers [0-9]. The length of the generated permutations should be 8. So far, I've built a simple brute ...
0
votes
1answer
54 views

Finding longest subsequence with sum less than a fixed number

I was trying to solve Problem 279-B. To find the maximum length of a continuous subarray in an array that is less than a given integer. e.g. [3,1,2,1] and 5 -> 3(1,2,1) ; [2,2,3] and 3 -> 1 I ...
1
vote
0answers
50 views

One producer and one consumer vs inconsistent shared resource state

I was reading about implementation of producer-consumer problem with one producer and one consumer. Looking at this paragraph I see the implementation where shared resource access is not synchronized ...
-1
votes
0answers
44 views

Algorithm for Multiple Choice Test Prep App

I'm working on app that helps students prepare for a specific exam. I have a database of 1000 questions, question categories, multiple choice options, hints and correct answers. Today, the app simply ...
2
votes
1answer
49 views

finding optimal token definitions for compression

I have a collection of strings which have a lot of common substrings, and I'm trying to find a good way to define tokens to compress them. For instance, if my strings are: s1 = "String" s2 = "Bool" ...
5
votes
0answers
103 views

Generating sort keys when reordering items

We have a number of items which the end user will be able to organize into a desired order. The set of items is unordered, but each item contains a sort key which can be modified. We're looking for ...
1
vote
1answer
82 views

Fast straight-line-integrals over a discrete grid

I have a grid that represents a sampling of a continuous function in a 2 dimensional space. I'm looking for a (preferably fast) algorithm that can calculate the discrete line integral along a straight-...
0
votes
0answers
33 views

Algorithms for Distribution and Logistics problem

I am looking for a way to express the following logistics/distribution problem as an equation that could be solved with a solver (optimization). Or if there is an known algorithm that would most fit ...
0
votes
2answers
174 views

How to implement backtracking to check if all fields have been traversed

I have been learning algorithms and trying to solve problems and now I have the following problem: In a 4x4 matrix, and it contains fields with height. There is a start field with given height also ...
1
vote
1answer
105 views

Understanding recursive solution of some algorithm

Most of the time we need to understand someone else' code for example I am studying Graph Algorithms from Sedgewick's online resources, the particular code example is taken from cycle detection ...
1
vote
1answer
50 views

Generate a string generator (constant associative array)

There is a finite set of unique strings and a limited key space. One key corresponds to one string value and a function must exist to perform the resolution. There is no need to support other ...
0
votes
0answers
27 views

I am trying to make a function with that returns true/false if an element is in the vector but I am getting an error? [migrated]

I am trying to implement a function in C++ using STL which takes an object and a vector of objects and return true if the vector contains the object else false. Below is the implementation of the ...
2
votes
0answers
45 views

Most efficient way of allocating participants to conference tracks

I am redesigning a system by which conference participants can choose which track they want to attend. Participants express their track preferences arranging them in order and submitting them at a ...
0
votes
1answer
58 views

How to traverse “linked list” like structure with parallel nodes

I am working on a signal processing project that allows for parallel processing on data streams as well as inputs and outputs to and from multiple endpoints. The signal chain is broken down into "...
1
vote
1answer
48 views

Finding longest ambiguous words with a given set of letters

I have been playing hangman with my friend over an app for a while now, and we have a gentlemen's understanding between us that we are both "cheating" by using online software both to solve the given ...
0
votes
1answer
77 views

Trying to find time complexity of modulus algorithm

I can't quite figure out the time complexity of this algorithm I've written for finding the modulo. I've added it here in psuedocode. Modulo(int x, int n) // x is the dividend, n is the divisor e ...
1
vote
2answers
35 views

Listing search/query results from 30+ web services efficiently and orderly

We have a system that currently has approx 25 customers (will never expand from this) that each have a public facing web service which allows each other to query each others internal application ...
0
votes
1answer
46 views

Algorithm for matrix positioning

Lets say I have an original mxn matrix like this: 1 2 3 4 5 6 7 8 For the purpose of my program, I then concatenate the rows into this new one dimensional matrix: 1 2 3 4 5 6 7 8 I know the mxn ...
1
vote
2answers
147 views

How to calculate business days difference without a lookup table

How can I calculate the number of buisness days (M-F, agnostic of Holidays) between two dates without a look up table? There has to be some sort of algorithm based on the number of all days and the ...