 45 Answered Questions for the topic Algorithm

Algorithm Math Permutations

03/10/20

#### Permutations algorithm maximum difference/contrast

Hello, I was wondering what would be the algorithm for permutations with 5 numbers and 4 possible kinds of numbers used and order being important. To make each iteration as different as possible... more
Algorithm Statistics Java

02/12/20

#### How to generate random numbers with specific mean

Is there any formula that I can understand which will allow me to generate random numbers with a specific mean. I'm using java. Thanks

12/26/19

#### What are some approaches/algorithms to solve the problem of supply-demand-price?

Problem statement: transport some products from (A, B, C) to (D, E, F), each place has a specified amount of supply (from) and demand (to). Each route has multiple choices (multiple vendors) and... more
Algorithm It Steps

09/16/19

#### Write pseudocode Centigrade and Fahrenheit are two scales to measure temperature.

Write pseudocode and that prompts (input) the user to enter Centigrate and then print the Fahrenheit.Use following formula for conversion.

08/02/19

#### Could a truly random number be generated using pings to pseudo-randomly selected IP addresses?

The question posed came about during my comp sci lecture while discussing the impossibility of generating numbers in a deterministic computational device.This was the only suggestion which didn't... more

08/01/19

#### Help Understanding Big O

I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were... more

#### Which is the fastest way to get the absolute value of a number?

How fast is an if (and why please). My college programing professors always told me to avoid ifs for they are extremely slow, but I always forgot to ask how slow and why.

07/25/19

#### Anyone know anything about OLAP Internals?

I know a bit about database internals. I've actually implemented a small, simple relational database engine before, using ISAM structures on disk and BTree indexes and all that sort of thing. It... more

07/21/19

#### What is an NP-complete in computer science?

What is an NP-complete problem? Why is it such an important topic in computer science?
Algorithm Geometry Python

07/12/19

#### How to efficiently determine if a set of points contains two that are close?

I need to determine if a set of points (each given by a tuple of floats, each of which is in [0, 1]) contains two that are within some threshold, say 0.01, of each other. I should also mention that... more
Algorithm Logic

06/27/19

#### What's the approach to solving this kind of logic problem?

What would be the approach to a kind of problem that sounds like this: A says B lies B says C lies D says B lies C says B lies E says A and D lie How many lie and how many tell the truth? I... more
Algorithm C++ C

06/26/19

#### Digit-increasing number test?

A number is called digit-increasing if it is equal n + nn + nnn + ... for some digit n between 1 and 9. For example 24 is digit-increasing because it equals 2 + 22 (here n = 2). Actually, a friend... more
Algorithm Math Geometry

06/19/19

#### How do you find a point at a given perpendicular distance from a line?

I have a line that I draw in a window and I let the user drag it around. So, my line is defined by two points: (x1,y1) and (x2,y2). But now I would like to draw "caps" at the end of my line, that... more
Algorithm Geometry 2d

06/19/19

#### How do I calculate the area of a 2d polygon?

Assuming a series of points in 2d space that do not self-intersect, what is an efficient method of determining the area of the resulting polygon? As a side note, this is not homework and I am not... more
Algorithm Java Logic

06/19/19

#### Display 1,2,3,4,5,6,8,10,11 as 1-6,8,10-11?

> I have this sequence **1,2,3,4,5,6,8,10,11** > > Expected output is **1-6,8,10-11** This problem is about formatting the sequence in easy readable form I tried with c# and used many... more
Algorithm Java Logic

06/19/19

#### Fastest way of finding the middle value of a triple?

Given is an array of three numeric values and I'd like to know the middle value of the three. The question is, what is the <i>fastest</i> way of finding the middle of the three? My... more
Algorithm Java Logic

06/19/19

#### Parsing Java Source Code?

I am asked to develop a software which should be able to create Flow chart/ Control Flow of the input Java source code. So I started researching on it and arrived at following solutions: To create... more
Algorithm Java Logic

06/19/19

#### All possible words?

I want to create all possible 5 letter words using a-z.Please suggest any good and fast algorithms. I have tried creating one and it looks something like this... byte[] allchar=new byte[]... more
Algorithm Python Intersection

06/14/19

#### Removing duplicates in lists?

Pretty much I need to write a program to check if a list has any duplicates and if it does it removes them and returns a new list with the items that werent duplicated/removed. This is what I have... more
Algorithm Unix Pi

06/03/19

#### What is the fastest way to get the value of π?

I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using #define constants like M_PI, or hard-coding the... more

06/01/19

#### What is tail recursion?

While learning lisp, I've come across the term *tail-recursive*. What does it mean exactly?
Algorithm Geometry Coordinates

05/29/19

#### How do I check if cartesian coordinates make up a rectangle efficiently?

The situation is as follows: - There are N arrays. - In each array (0..N-1) there are (x,y) tuples (cartesian coordinates) stored - The length of each array can be different I want to extract the... more
Algorithm Geometry Python

05/29/19

#### Find equidistant points between two coordinates?

I have a function which needs to take out equidistant points between two points on the screen(2d). Like this - |--------------| The distance is already decided. For example, I take it as 2... more

05/24/19

#### The shortest path between two integers by adding or subtracting?

You are given two integers a and b. You want to find the shortest sequence of operations necessary to transform a into b, where at each step you are allowed to add or subtract 5, 7, or 12. For... more
1

## Still looking for help? Get the right answer, fast.

Get a free answer to a quick problem.
Most questions answered within 4 hours.

#### OR

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.