Questions tagged [bottom-up]
84 questions
0
votes
2 answers
Is the following approach dynamic programming
As far as I know, DP is either you start with bigger problem and recursively come down, and keep saving the value each time for future use or you do it iteratively and keep saving values bottom up. But what if I am doing it bottom up but recursively…

Kraken
- 23,393
- 37
- 102
- 162
0
votes
1 answer
Error on memory allocation in c++
I am writing code for bottom-up merge sort in c++, but this error occurs on a line where I am allocating memory to a pointer,
void merge(int *a, int low, int high, int mid,int max)
{
int i, j, k;
int *c=new int[max]; //error occurs here
…

user3324329
- 59
- 8
0
votes
1 answer
Bottom-Up-Parser: When to apply which reduction rule?
Let's take the following context-free grammar:
G = ( {Sum, Product, Number}, {decimal representations of numbers, +, *}, P, Sum)
Being P:
Sum → Sum + Product
Sum → Product
Product → Product * Number
Product → Number
Number → decimal representation…

Hyperboreus
- 31,997
- 9
- 47
- 87
0
votes
1 answer
Can some one please provide the practical examples of stubs and drivers?
I need some practical examples of stubs and drivers with respect to top-down and bottom-up approaches to testing. I don't require code here. Just the scenario based examples.

Aditya
- 425
- 3
- 8
- 22
0
votes
1 answer
Top-down vs Bottom-up Approach
I understand the difference between the two approaches of web Development. But are there any situations when a specific approach is advantageous over the other ? And downside of one over the other ?
I read this in an article: In top-down, if we…

dharag
- 299
- 1
- 8
- 17
0
votes
1 answer
Using jax-ws annotations to determine the request/response wrapper element
i am trying to create a web service using the bottom-up approach by first creating the java class. My implementation looks like the following :
@WebMethod(operationName = "addNumbers")
public String addNumbers(
@WebParam(name =…

ntheo
- 27
- 7
-1
votes
1 answer
Top down heap construction when getting element one by one
so I read that when you are getting elements one by one you should use bottom up heap constrcution rather than heapify which is top down, but What if i use the heapify algorithm every time i add a new element , basically doing the same from n/2 to 1…

Tarun Prakash Singh
- 21
- 3
-1
votes
1 answer
How to Maximize Product of Rod Cutting using 2D Table?
We are given a rod of length n inches. You can cut it in different parts of integer lengths.
Your goal is to get the maximal product of lengths of all parts possible.
You must make at least one cut. Assume that the length of rope is more than 2…

block-ch
- 27
- 1
- 6
-1
votes
1 answer
how to know all the length of cuts of rod in rod cutting algorithm ? (dynamic programming)
i know the rod cutting algorithm. The c++ implementation is below:
// A Dynamic Programming solution for Rod cutting problem
#include
#include
// A utility function to get the maximum of two integers
int max(int a, int b) {…

SwadhIn
- 717
- 1
- 9
- 19