algorithm Questions

4

Solved

I have encountered a game called Tower Breakers, which seems a variation of the nim game. There are two players, player 1 and player 2. Initially there are n towers, where each tower is of height...
Preachment asked 13/1, 2017 at 20:48

2

Solved

Attached is a picture with curved lines, how can you find the Baseline of the text? The goal is to get lines like I drew by hand in the following picture: I tried the following code, but letters ...
Dasilva asked 4/6 at 10:46

2

Solved

Can somebody please explain this code to me? I understand what it does but I don't understand how it works. # >n 0 d [->+>-[>+>>]>[+[-<+>]>+>>]<<<<...
Sullins asked 12/1, 2015 at 15:51

4

Solved

As I to my surprise failed to find a Python numpy method able to put an array split into its right to left diagonals in first place back together from the obtained diagonals, I have put some code t...
Hoi asked 19/5 at 6:31

3

Solved

The context of this question is the creation of a side-channel resistant implementation of a IEEE-754 compliant single-precision square root for a 32-bit RISC-V platform without hardware support fo...

1

Solved

That's a problem from Polish Olympiad in Informatics, called Pionek (PIO). Given a set of not unique vectors, find the greatest possible euclidean distance in reference to (0,0) point you can achie...
Martyrology asked 9/6 at 18:29

3

Solved

I have a rectangular matrix with n rows and m column. All entries of the matrix are natural numbers (including 0). Among the m columns, I'm given some index, j (< m). I'd like the matrix to beco...

22

Solved

I know how to make the list of the Fibonacci numbers, but I don't know how can I test if a given number belongs to the fibonacci list - one way that comes in mind is generate the list of fib. numbe...
Manakin asked 12/3, 2010 at 12:30

5

Could anyone help me with this problem? I'll type out the problem, then give some of my thoughts/alternative solutions. So the problem pretty much is, given a single string of brackets like this: ...
Calvin asked 18/11, 2012 at 2:45

7

Solved

Say we have string a = "abc" string b = "abcdcabaabccbaa" Find location of all permutations of a in b. I am trying to find an effective algorithm for this. Pseudo code: sort st...
Kr asked 6/1, 2017 at 22:3

4

Solved

I want to create a 32-bit number out of an ASCII-string. CRC32 algorithm is exactly what I'm looking for, but I can't use it because the table it requires is way too huge (it is for an embedded sys...
Feudalize asked 14/1, 2015 at 9:44

3

I have been going through prime number generation in python using the sieve of Eratosthenes and the solutions which people tout as a relatively fast option such as those in a few of the answers to ...
Schwaben asked 14/4, 2013 at 21:15

10

Solved

We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the arra...
Subdominant asked 6/8, 2008 at 10:23

3

I have incoming data and I want to compute the average, 95th and 99th percentile of that data - I am most interested in the last 1000 values. At any time, I'd like to query this object to get any o...
Hungary asked 8/5, 2013 at 22:23

8

Solved

I have recently attended a programming test in codility, and the question is to find the Number of bounded slice in an array.. I am just giving you breif explanation of the question. A Slice of a...
Truncated asked 21/1, 2014 at 7:22

0

Problem set This is somewhat a generalization of the famous partition of integer n into k parts. Given two integers a,b I need to find the number of partitions into k distinct parts that sum ...
Outport asked 2/6 at 14:22

4

this is really dumb but what does zookeeper do that raft doesn't - not talking about zab but zookeeper itself. I get raft does leader election etc. w servers but what's the point of zookeeper? is ...
Rutilant asked 11/12, 2017 at 19:56

4

Solved

I came across a coding challenge on the internet the question is listed below: Have the function FoodDistribution(arr) read the array of numbers stored in arr which will represent the hunger level...
Oppugnant asked 19/5 at 14:28

7

Solved

I'm working on a HackerRank problem that's finding the largest sum of the elements in upper-left quadrant of a 2N x 2N matrix after reversing rows and columns. For example, if the matrix is M = [ ...
Microclimate asked 23/10, 2016 at 17:7

2

I was doing an online interview some days back and came across this task that we can reach the nth step by using only steps 1 or 2 or 3. Updated Question: A child is running up a staircase with n s...
Kif asked 24/3, 2021 at 22:45

2

Solved

I am looking for a video scene detection algorithm implementation. Any programming language used for the implementation is acceptable. I found this implementation but it is very sensitive to small...
Purpose asked 26/1, 2011 at 2:55

3

Solved

I'm looking for the algorithm of backward and forward chaining to implement it with Python. I looked on the internet, but I didn't find too much. I looked in Wikipedia too but I just found some rul...
Ginnygino asked 26/3, 2017 at 11:49

4

Solved

I want to compute nCk mod m with following constraints: n<=10^18 k<=10^5 m=10^9+7 I have read this article: Calculating Binomial Coefficient (nCk) for large n & k But here value of ...
Carlotacarlotta asked 5/2, 2016 at 14:39

3

Solved

For the following problem: The output/correct result is specified as: Output: [3,9,20,null,null,15,7] I'm not sure what that output actually represents. I tried to scan it by level . E.g 3 is th...
Elanorelapid asked 29/4, 2021 at 19:46

12

Solved

How do you differentiate between an algorithm and a method? Why dont we call Newton's Method or Ford-Faulkerson method Algorithms? What are a properties of a good algorithm and what qualifies a met...
Yelena asked 18/5, 2009 at 18:0

© 2022 - 2024 — McMap. All rights reserved.