How to Write a recurrence relationship for the algorithm described
(b) An algorithm process an array of size n in two parts, A and B of equal size. Part A is processed recursively, one element at a time, until a single element remains. Part B is processed recursively by dividing it into three equal parts until it is no longer divisible.
(i) Write a recurrence relationship for the algorithm described above.
(ii) Solve the recurrence relation using the substitution method. Clearly show the steps in the computation.
Algorithms the comparsion of function
I’m learning algorithms from abdul bari videos and I’m confused about something in the context of function comparsion if f(n) = 3n^(√n) and g(n) = 2^((√n)log(n))
Online algorithm – Ski rental problem with a small twist
I am trying to solve the ski rental problem with a small twist but I cannot seem to fully understand the solution or how to get there.
Any help is much appreciated.
How do i remove two of the same item from an array
im working my way through the odin project and looking at for loops and different methods. Im trying to find a way to pass this test :
Find smallest base such that integer exceeds M in O(log M) time
You are given a string s
consisting of digits 0
–9
and of length at least two. Further, you are given an integer M
. Find the smallest base b
such that the string s
when interpreted in base-b
exceeds M
.
Distribute Coins in Binary Tree
I am reading the solution of this problem
Algorithm for cheapest shop basket
I’m trying to find an algorithm for this problem. Ideally in ruby but any language would also be great:
I have a question regarding the path search algorithm
Is there a paper or website article that explains what a particular path-finding algorithm does by changing how to delete a node, etc., when it works?
Optimization problem algorithm: splitting elements that are preferred to be together [closed]
Closed 6 mins ago.
Launch order and delay times to make operations finish in a desired order
Let’s say I have three operations that each take different time to complete:
“hack” takes 10 seconds
“grow” takes 20 seconds
“weaken” takes 30 seconds
I want to launch these operations in such a way that they finish one after another in a specified order. For example I want grow to finish first, followed immediately (Realistically with a small delay like 200ml) by hack finishing, and then weaken finishing. Is there some kind of algorithm I can follow to figure out in which order I should launch my operations and how long to wait before launching each operation?