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)

-2
votes
2answers
456 views

Common and frequently used algorithms of Data structures? [closed]

I have been programming for a while, and the edge that I am missing over other programming is algorithms. I know what is linked-list and binary tree, but I dont know many more of them. I failed on 2 ...
3
votes
1answer
194 views

Processing every leaf under a node in a tree efficiently

Short version: In a tree (non-binary) with many levels of children, where each node can have multiple leaves, what is the best way to tally leaves that meet a certain condition given a node? Long, ...
1
vote
1answer
161 views

What is the name of this array transformation?

Start with an array of arrays; in this case, they are different lengths in order to demonstrate the technique, but they do not have to be. [[1,2,3,4], [5,6,7], [8,9,10], [11,12,13,14,15]] At the ...
5
votes
1answer
209 views

Bin sorting problem - Please help categorize

I have a problem I am developing a solution for and currently I solve it with a brute force solution that checks all possibilities. It works for small numbers of bins but I'd like to work with a ...
0
votes
2answers
428 views

How do you come up with algorithms?

I picked up some Project Euler questions today and decided to find more effective ways to Answer the questions l had already answered. So on the question about finding the sum of the even Fibonacci ...
18
votes
2answers
957 views

What class of problem is this, and what math do I need to know to solve it?

Mushroom cultivation requires fairly precise chemical composition of substrate (a.k.a. growing medium). Let's pretend we're growing shitakes and that this is the required composition of their ...
10
votes
11answers
7k views

What is an algorithm?

What exactly is an algorithm, as in what does Algorithm mean? The little I understand the word, is that it's not specific to a particular language, or design pattern, rather it's one the most basic ...
4
votes
2answers
312 views

Do Tech Firms use a lot of Algorithmic Practices that we studied in college? [closed]

I am yet to start my career, I have a profound interest in algorithm design. I somehow fail to understand that, how would a tech firm use the algorithmic paradigm? I mean in real life projects do we ...
2
votes
2answers
659 views

Optimize Reading of Multiple files

I have a unique problem which I'm hoping someone can assist with. I have One big text file, our Production file. The data in the file is delimited in the following format Reference|Cost ...
3
votes
2answers
599 views

Text search - big data problem

I have a problem I was hoping I could get some advice on! I have a LOT of text as input (about 20GB worth, not MASSIVE but big enough). This is just free text, unstructured. I have a 'category ...
6
votes
3answers
247 views

How can degree of order in a list be measured?

The following questions gave me food for thought: Efficient way to shuffle objects I'd like to write an "ultimate shuffle" algorithm to sort my mp3 collection When you sort a list - ...
5
votes
2answers
352 views

Structuring Access Control In Hierarchical Object Graph

I have a Folder entity that can be Moderated by users. Folders can contain other folders. So I may have a structure like this: Folder 1 Folder 2 Folder 3 Folder 4 I have to ...
0
votes
3answers
164 views

Suggestion for a Non-CSE developer [closed]

Due to financial problems, I couldn't go for CSE in my country and had to settle for a BCIS honors degree. Now, after quite some time, when I want to go for a higher position in software development ...
17
votes
4answers
5k views

Return random `list` item by its `weight`

I have, for example, this table +-----------------+ | fruit | weight | +-----------------+ | apple | 4 | | orange | 2 | | lemon | 1 | +-----------------+ I need to return random ...
1
vote
2answers
90 views

Fair 2-combinations

I need to fairly assign 2 experts from x experts (x is rather small - less than 50) for every n applications, so that: each expert has the same number of applications (+-1); each pair of experts ...
5
votes
4answers
650 views

How to familiarize myself with Python

I'm a Python beginner. I started programming with Python 1.5 months back. I downloaded the Python docs and read some parts of the tutorial. I have been programming on codechef.com and solving ...
-1
votes
3answers
191 views

programming practices starting [closed]

I have taken my major as computer science and Engineering and I am really confused at this moment. My first course was about learning C and C++ and I learned the basics of those. Now I am really ...
-1
votes
2answers
2k views

What do I need to know about Data Structures and Algorithms in the “real” world [closed]

I just finished the data structures and algorithms course in school , I took it during the summer so 6wks course vs a 16 wk course during the regular semester. So not only was the course hard but it ...
6
votes
3answers
1k views

Why is Quicksort called “Quicksort”?

The point of this question is not to debate the merits of this over any other sorting algorithm - certainly there are many other questions that do this. This question is about the name. Why is ...
4
votes
1answer
765 views

Randomization of biomes

You know how in Minecraft, the World is ever-expanding and all the biomes are randomized? My generalized question is: In relation to a space simulation that is also ever-expanding as the player moves ...
2
votes
3answers
364 views

best and most used algorithm for finding the primality of given positive number [closed]

When I was in college and as a programming language learner I wrote program for finding out prime numbers but then I never mind the program performance in terms of speed. Now after long time just ...
30
votes
3answers
2k views

How will quantum computing change programming? [closed]

How is programming a quantum algorithm different? What would a C like language look like if it was designed for qubits? Would types change?
6
votes
3answers
2k views

What algorithm(s) can be used to achieve reasonably good next word prediction?

What is a good way of implementing "next-word prediction"? For example, the user types "I am" and the system suggests "a" and "not" (or possibly others) as the next word. I am aware of a method that ...
1
vote
2answers
993 views

Finding duplicate files? [duplicate]

I am going to be developing a program that detects duplicate files and I was wondering what the best/fastest method would be to do this? I am more interested in what the best hash algorithm would be ...
3
votes
1answer
281 views

Suitable algorithm for joining records from multiple databases

I am in the process of writing a library that is used to be able to access data from a database. The library requires the initial definition of all the tables that the application will be using in the ...
5
votes
3answers
609 views

What could an algorithm look like that iterates through all combinations of two variables to aim at a certain number of entries?

For background information, see "Some background" further down. I have a list that looks like this: Start-Time-In-Seconds;End-Time-In-Seconds 1;2 4;6 12;15 ... This works together with a wave file ...
2
votes
1answer
220 views

How to compute amoritized cost for a dynamic array?

I am trying to understand how to do the amortized cost for a dynamic table. Suppose we are using the accounting method. Let A of size m be an array of n elements. When n = m, then we create a new ...
1
vote
1answer
105 views

How to compute a signature of a matrix

We know some signature/checksum methods for text, like md5,sha. Now, I want to compute a checksum for a matrix, to represent the exact matrix. Say, two matrixes with different sizes, or with ...
-1
votes
2answers
76 views

Store a tree with near next neighbours

I would to find an efficient structure (speed and volume) to store nodes and their neighbourhood. My input is build out of stings in the following format ./X/Y.log where X ∈ [0,359] and Y ...
0
votes
0answers
173 views

Development of algorithmical concept for scheduling and allocation problem

I have to solve a problem in the field of operations research. I want to gather some general approaches to evaluate them to pick the most promising to design a problem-related program. Problem ...
8
votes
3answers
499 views

What the correct algorithm to invert italics in a mixed text?

The question motivations was depicted in the section below. There are many ways to make text italic, so, perhaps, there are more than one good "swap italics algorithm". The problem reveals some ...
2
votes
1answer
201 views

Algorithm in undirected BFS graph

I'm trying to put together an algorithm that will display the node degree for every node in a breadth first tree graph (assume BFS was called). Assume it's an undirected graph. I'm not sure how to ...
1
vote
1answer
247 views

Is there a time bomb in sequential process id allocation when the `unsigned` wraps?

I'm designing and implementing a multiprocessing postscript interpreter ("lightweight" processes simulated by a single OS-thread), and I need to generate a unique identifier for each process in the ...
-1
votes
2answers
264 views

Just in time prize winning algorithm [closed]

I'm building a contest where you can win prizes by opening boxes. Whatever the box is open, i just send a request to the server to test if the user won something. Since this contest is not a "Register ...
1
vote
0answers
158 views

Algorithm for generating hyperexponential distribution

I need to generate a hyperexponential distribution for my project. I have already implemented a poisson generating algorithm given by Donald Knuth, but I couldn't find an algorithm for generating a ...
0
votes
1answer
274 views

How can I reduce my problem into Max flow problem?

I am trying to reduce my problem to a max flow problem so I can run the max flow algorithm on this problem. But there are some things that I am missing while transforming my problem. My problem is: ...
4
votes
2answers
99 views

Placing elements in graph with a streaming/online algorthm

We have a stream of points with about 1000 points per second. For each point, we have a complex vector (hundreds of dimensions). Our goal, for each point is to link it to the 5 closest points that ...
1
vote
3answers
1k views

Search for a sub-string in a given array of strings

I have an array of n strings. I want to select all the elements of the array that starts with the given string. Sorry if that is not clear. I'll give an example. input = "as" array = ["abas", ...
0
votes
1answer
139 views

Does the ray tracing algorithm involves rasterization of image?

I am constructing a ray tracing algorithm , i know that the first step is to develop camera and view plane specifications. Now is the next step performing rasterization algorithm on image before a BVH ...
28
votes
4answers
2k views

What's the difference between recursion and corecursion?

What's the difference between these? Recursion Corecursion On Wikipedia, there is little information and no clear code explaining these terms. What are some very simple examples explaining these ...
5
votes
1answer
631 views

Where to learn graph theory applications [closed]

I am completely new to designing algorithms with graphs. I am following CLRS and other video lectures in Youtube, notably from IIT/MIT. They are pretty good, and I currently have decent idea about ...
2
votes
1answer
254 views

Which algorithms typify Lisp's power? [closed]

Similar question here (but not the same) because I am interested in which specific algorithms work particularly well in Lisp. Lisp tutorials always give the example of finding factorials, but wanting ...
7
votes
3answers
369 views

Change of the complexity class through compiler optimization?

I am looking for an example where an algorithm is apparently changing its complexity class due to compiler and/or processor optimization strategies.
8
votes
5answers
4k views

How can I extract words from a sentence and determine what part of speech each is? [closed]

I want to write something that takes a sentence and identifies each word it contains and defines what part of speech each word is. For example Hello World, I am a sentence would return this ...
0
votes
0answers
154 views

Algorithm to find last allocated job for each worker

Let's say we have n jobs numbered from 1 upto n and k workers numbered from 1 upto k. All the jobs are equally difficult, but some workers are more efficient than others, so we are given the time it ...
3
votes
1answer
230 views

Algorithm, AI, or intelligent agent suggestions for ingesting poorly-formatted & variable data from different document types

Thanks for looking! Background I have been tasked with writing a program to normalize and ingest data from various sources to a common database. For the sake of simplicity, let's say that the ...
0
votes
0answers
73 views

Efficient Copy While Sorting

I have an algorithms library called NDex. I am in the process of upgrading it to a new version. Part of this upgrade involves providing two versions of many algorithms: an in-place version and a ...
-4
votes
3answers
179 views

Is there something which can write the function for me given the pattern?

For example I have the following. The inputs are on the left. The outputs are on the right. The second term in the input which is the number 3 is the number of output numbers I want. It would be ...
-1
votes
2answers
1k views

Algorithm for dividing a range into ranges and then finding which range a number belongs to

Having a minimum a maximum number of ranges a value between minimum and maximum I'm trying to come up with a method, or two, which would calculate which range the provided value belongs to. For ...
2
votes
1answer
106 views

Algorithm for Cyclical Sequence Alignment

Let's say we have 3 cyclic sequences, each of them of length n and containing every number from the interval 1..n once. The goal is to align the sequences in order to maximize the number of matches ...