Questions tagged [bottom-up]
84 questions
1
vote
0 answers
Which one to select "Top Down" or "Bottom Up" approach in DP?
Bottom up technique looks little bit easier when it comes to solve a question(my view), but whether it can be used everywhere where we are using Top Down approach or is there any specific instance when we can or we should use bottom up technique ?

Anurag
- 11
- 2
1
vote
1 answer
Dynamic Programming Longest Increasing Subsequence
I need help understanding this. How are the elements in the parent list given - like which list of the previous element in the sequence is it referring to? I've tried testing for each list and I'm still getting a different parent list. Sorry in…
user10382706
1
vote
1 answer
What do the different kinds of LR Parsers use as lookahead?
Is it correct, that LR(0)-Parsers simply reduces, if there is no transition for the next input-symbol (because it has no lookahead) ?
Is it correct, that SLR(1)-Parsers use the FOLLOW-Set of the productions as lookahead?
Is it correct, that…

von spotz
- 875
- 7
- 17
1
vote
0 answers
Approach handling data that are introduced “Bottom-up” and refined “Top-down”
(This question is about strategy and high-level approach to data refining, not programming, so if it is off-topic... sorry in advance, but I couldn't find a better stackexchange community)
So, we are in a (typical) scenario in which new data are…

fustaki
- 1,574
- 1
- 13
- 20
1
vote
1 answer
Is Bottom Up Dynamic programming recursive?
In this approach smaller subproblems are computed and results are cached, then we compute the bigger subproblems for which we use the already computed optimized values of the smaller subproblems from a table which cached the earlier computed values.…

Deba
- 429
- 3
- 8
- 18
1
vote
1 answer
Bottoms-up mergesort problems!
I am having problems with bottoms-up mergesort. I have problems sorting/merging. Current code includes:
public void mergeSort(long[] a, int len) {
long[] temp = new long[a.length];
int length = 1;
while (length < len) {
…

LKANL
- 69
- 1
- 2
1
vote
0 answers
dynamic programming dictionary exercise bottom-up approach in java
Here is the problem i want to solve:
You are given a dictionary, i.e. a set S of m strings, and a separate string t. You are required to output the minimum number of substrings that t can be broken up to, such that the union of these substrings is…

participant5
- 51
- 4
1
vote
1 answer
When to reduce in a shift-reduce parser?
This is the skeleton of my bottom-up parser:
while (!stack.empty())
{
if (!reduce())
{
shift();
}
}
And I have these rules:
Program -> Expr
Expr -> Expr '+' Expr
Expr -> Number
Number -> FLOAT | INTEGER // These 2 are terminal…

Peter Lenkefi
- 1,306
- 11
- 29
1
vote
1 answer
Scrolling top-bottom is not working
I have a problem with scrolling, 2 of if conditions activate all time after some delay. I can't understand why. Here is the site I have problem with: www.fitfaza.pl - the grey anchor in the right-bottom corner.
code:
// hide #back-top…

Kamil Jankowiak
- 45
- 7
1
vote
2 answers
How to build the case for n=3 using bottom up recursion?
I am working on a problem from Cracking the Coding Interview, problem 9.6 page 110.
Here is the problem:
Implement an algorithm to print all valid (e.g., properly opened and closed combinations of n-pairs of parentheses. Examples
b(1) - "()"
b(2) -…

committedandroider
- 8,711
- 14
- 71
- 126
1
vote
1 answer
Image/Link alignment issue with bottom navbar
I have a small issue. I've added a bottom navbar with 3 social icons and a text to present what are these icons. Screenshot
I would like to put this text really at the right, or left, but not like this. It does the same thing if I do in the other…

XeloOw
- 27
- 1
- 6
1
vote
2 answers
How can I set the bottom-to-top-link button for my ListView in Android?
I want to create a bottom-to-top-link button in Andorid. I have a ListView with a large amount of data.
For an example have a look at this website. Imagine you scrolled down to the bottom of the webpage and you want to get back to the top of the…

Nava2011
- 195
- 1
- 15
1
vote
2 answers
building a bottomUp heap
im trying to do a heap bottom up construction from Psuedo code from my text book however the output im getting is not a correct heap im getting out 2 9 8 6 5 7
anyone know where im going wrong(pseudo code is from a text book, and heap needs to be…

hockeyfreak863
- 59
- 3
- 12
1
vote
2 answers
Dynamic Programming Card Game
Please check out this problem I have:
"You and your eight-year-old nephew Elmo decide to play a simple card game. At the beginning
of the game, the cards are dealt face up in a long row. Each card is worth a different number
of points. After all…

franpen
- 322
- 1
- 4
- 18
1
vote
2 answers
PHP tree menu, bottom-up
I'm having some issues getting a tree menu to work from bottom-up.
I already have a script to work from top-down, which works fine.
This is a very simplified version of my table:
+-----+-----------+--------------------+
| uid | parent_id |…

Phil Cross
- 9,017
- 12
- 50
- 84