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)

3
votes
1answer
83 views

Is this Red-Black tree insertion pseudocode from Introduction to Algorithms (CLRS) correct?

For the Red-black tree insertion fixup the book distinguishes between 6 cases, 3 of which are symmetric. The cases are (z is the node being inserted): Case 1: z's uncle is red Case 2: z's uncle is ...
-4
votes
0answers
24 views

Shamos and Hoey algorithm for identifying line segment intersections on a plane [on hold]

The following Programmer's question: Find all lines segments intersections is a question about the Shamos and Hoey algorithm for identifying line segment intersections on a plane. When we apply ...
-4
votes
0answers
21 views

Shamos and Hoey with an algorithm for identifying line segment intersections on a plane [on hold]

This is my code for the Shamos and Hoey with an algorithm for identifying line segment intersections on a plane. Where the x coordinates of the line segments are same which are l,r and the line ...
4
votes
0answers
29 views

Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3

I am creating a 2d game for a website where the universe can grow extremely large (basically infinitely large). Initially, the universe is composed of 6 stars that are an equal distance from the ...
-5
votes
0answers
51 views

hanging beads, could not find an approach to solve it [on hold]

There is chain with N beads, the i'th bead has weight Wi and price Ci. The chain is placed hanging from the edge of the table with K beads hanging and the remaining N-K beads on the table. You can ...
1
vote
4answers
122 views

Should I be using any algorithm to sort/find items, or use a language's built-in ways?

I'm currently a first semester IT student, and I'm wondering if it's better to write my method to find something e.g. in a C# List, or to use any built in method to do these, such as LINQ or .Find or ...
-2
votes
0answers
37 views

Efficiently updating information on adjacency in a circular list [on hold]

King Arthur meets his knights at a round table, with a total of n people at the table. Two individuals consider themselves "buddies" if they have sat next to each other at some meeting. A list of ...
4
votes
4answers
240 views

How to design a function that takes a date and gives out a number between 1-6, always the same for all dates

As a part of an algorithm I'm making I need to make a function that takes the current date to a function and gives out a number between 1-6, and not the same number for two consecutive dates. And it ...
-4
votes
0answers
47 views

How to understand this windowing code [on hold]

I have been trying to solve this programming challenge and have seen the solution below. I understand the first part where we are figuring out the start and end of where the numbers are decreasing and ...
0
votes
1answer
38 views

Create arithmetic expression from number using +-/* that equals target

For example, you are given the source 1234 and the target 24. The task is to use the standard arithmetic operators +-/* placed within source, without changing the order of the digits of source to ...
5
votes
2answers
92 views

Find path of steepest descent along with path length in a matrix

Came across this problem -- You are given a grid with numbers that represent the elevation at a particular point. From each box in the grid you can go north, south, east, west - but only if the ...
0
votes
0answers
177 views

What is a lattice parser?

My friend asked me for help with his task: "Redeem a lattice parser with any programming language" - the problem is that he can't clearly explain me how the lattice parser should work. I've tried to ...
6
votes
2answers
165 views

Efficient algorithm to merge n successive sorted arrays in place

I am developing an in-place sorting algorithm that leaves the array into a state where it is basically a succession of sorted subsequences of any size (most are bigger than log2(size(array))); then it ...
0
votes
1answer
134 views

Do you know the name of this algorithm? (cycle with history?)

Context : I'm a IT student who is trying to implement a small application for my family. Every year, we offer each other gifts. Each one of us pick a name of a family member in a hat, and have to ...
1
vote
0answers
31 views

Graph grouping with criteria

I start with a list of adjacent tetrahedra, where there are tight seals to one another along faces for two tetrahedra that are adjacent. The vertices belonging to these faces for both tetrahedra are ...

15 30 50 per page