1. A

    Differential Equations - Finite difference method

    Hi, I am new here and I hope to be posting my doubts in the right place! I am taking a PhD in mechanical engineering and I have a work to do applying the finite difference method to a differential equation. The problem itself consists in a heat transfer with a moving heat source at a constant...
  2. S

    Algorithm for convert binary search tree to max heap

    Hello, I have BST in a custom size and I want to convert it to max-heap. What algorithm do we have for this? Thanks
  3. J

    Gradient Boosting algorithm

    Bellow I have some math formulas of the gradient boosting algorithm, I want to know what is mean with this? Step 1 $\hat{f}(x) \leftarrow \hat{f}(x)+\lambda \hat{f}^b(x).$ Step 2 $r_i \leftarrow r_i - \lambda \hat{f}^b(x_i).$ Final step $\hat{f}(x) = \sum_{b=1}^B \lambda \hat{f}^b(x).$ How...
  4. J

    How do I create this algorithm pseudocode in latex?

    How do I create this algorithm (see bellow picture)pseudocode in latex? Or something similar looking (the indentation is important)
  5. S

    Idea for Recursive Algorithm

    I have a question and I knew you cannot give a complete solution and I need some tips. I should solve this problem with the recursion algorithm. For the last row: The first and second numbers add together then second and third numbers add together and finally third and fourth number add...
  6. Y

    Euclid Algorithm Mathematical Induction

    Hello, This is my second post on this form, so please let me know if I should move it to a more suitable section or use better formatting. I have this exercise in the book Algorithms by R. Sedgewick and K. Wayne: Use mathematical induction to prove that Euclid’s algorithm computes the...
  7. S

    Algorithm question

    Please someone check if my solution is right for (a)? a) The mystery function basically finds the sum of digits in a number x. For ex., It works like initially Lets say x=123 So, Initially sum=0 So, Since x is not zero so it will enter loop So...
  8. A

    Reverse of a floating or decimal point number

    Reference : Is it possible to write a computer program which will reverse a decimal or floating point number? Example : 341.54 Output : 45.143 Do we have to just change the data type to float or double instead of...
  9. N

    Boolean optimization algorithm

    The problem and an example of the situation is presented in the 3 files below
  10. U

    Algorithm that may solve coloring problem

    I have a sudo code that is supposed to try to solve a minimum coloring on a graph. And the question is: Does this code solve this minimum coloring problem to any given graph? Code: for (v = v0; v < vn; v++) v >color = 1; k = 0; do { flag = 0; k++; for...
  11. L

    Approximated vertex cover algorithm on random graph

    I'm trying to investigate the results of running the following factor two algorithm for minimum vertex cover on random graphs. To be more specific, for a given number of vertices $n$ I'm trying to find the smallest $p$ so that running the approximation algorithm above on a...
  12. B

    Multiplication Algorithm

    Hello all, I made a post a few months back asking about methods for squaring 2-digit numbers after I recognized a pattern and you friendly folks told me I had actually stumbled upon an old method that had long fallen out of use. My question today focuses on multiplication in general. Last...
  13. P

    Data Compression Techniques.

    What are the algorithms for Data Compression utilities? Example - Pkzip,Pkunzip,WinRar etc Thanks & Regards, Prashant S Akerkar
  14. J

    Neville algorithm

    Hello, I post this message because in the following exercise I am asked to use the Neville algorithm, and I do not know exactly how to use it and whether I have the right formula. Here is this exercise: Let f be a real function whose value is known in 5 points: 0 <= i <= 4 xi = {- 1,1,1,2,3}, f...
  15. Yooklid

    Looking for Numerical Integration algorithm

    I have a decaying cyclical function that I need to integrate. I've been using Simpson's rule so far. In order to get the precision that I need, the function has to be evaluated tens of thousands of times. I've tried other methods that are often advertised as being more efficient (such as Gauss...
  16. M

    Number Theory / Fast Factorization Algorithm 2017

    Hello, through the following link you can see my fast factorization algortihm: Thanks and best regards, Miguel.
  17. S

    Algorithm Problem

    Mario came to class, wiped the blackboard and wrote on it the numbers 1 to 50, each exactly once. Kaja is going to play with these numbers. Exactly 49 times repeats the following procedure: chooses any two numbers on board, she erases both of them, and then on the board writes the value of...
  18. P

    Minkowski Sum Algorithm

    I am trying to program the following algorithm to calculate the Minkowski sum of two convex polygons: (Taken from Computational Geometry Algorithms and Applications (ISBN 978-3-540-77974-2) (Year 2008, Page 295)) It already works for simple polygons, but when I have something like this the...
  19. J

    Algorithm Help

    Hello, I am trying to find an efficient algorithm to get the following information. Find A, B given integer N >= 1 where 8N = (A * B) + A and ABS(A - B) is the minimum value given N. Does anyone have any pointers, or has seen a similar algorithm out there? It is similar to...
  20. Q

    Computer Complexity of a real case scenario: facility location

    There is a problem of facility location that I solve with genetic algorithms. I can get good results. So I would like to compare my genetic algorithm complexity O(n^2) with the brute-force algorithm. But I am not getting an answer. (n = number of individuals in my population, usually 200.)...