pseudocode

How to return the value of a swap function

How to return the value of a swap function Question: I want to ask if i can return more than one value using function. when i make a function that is not necessarly returning one value like the swap functin,I’m not sure how to deal with it.Because in the end i want to return the …

Total answers: 1

How can I convert psuedocode to mergesort algorithm?

How can I convert pseudocode to mergesort algorithm? Question: I need to convert pseudocode into a merge sort algorithm that mirrors that pseudocode. I am new to pseudocode so I’m having trouble with this. Can anyone tell me what is wrong with my algorithm? Please note that the arrays in the pseudocode are 1-indexed. PSEUDOCODE: …

Total answers: 2

Do I need custom random-number generator for Perlin noise?

Do I need custom random-number generator for Perlin noise? Question: Perlin explained in pseudo-code: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm The tutorial gives me a random number generator function writen in pseudo-code. Returns a floating number in the range of (-1, 1). function IntNoise(32-bit integer: x) x = (x<<13) ^ x; return ( 1.0 – ( (x * (x * …

Total answers: 1

Maximum Likelihood Estimate pseudocode

Maximum Likelihood Estimate pseudocode Question: I need to code a Maximum Likelihood Estimator to estimate the mean and variance of some toy data. I have a vector with 100 samples, created with numpy.random.randn(100). The data should have zero mean and unit variance Gaussian distribution. I checked Wikipedia and some extra sources, but I am a …

Total answers: 4

Algorithm to find which number in a list sum up to a certain number

Algorithm to find which number in a list sum up to a certain number Question: I have a list of numbers. I also have a certain sum. The sum is made from a few numbers from my list (I may/may not know how many numbers it’s made from). Is there a fast algorithm to get …

Total answers: 5