Skip to main content
1 vote
0 answers
145 views

I encountered with this problem while reading about Precedence climbing and Pratt parsing. This may be duplicate with this QA but that doesn't say much about Precedence climbing and Pratt parsing. The ...
An5Drama's user avatar
  • 774
1 vote
1 answer
96 views

I am trying to initialize a 2d array (matrix) to 0 but, cant do it: int longestCommonSubsequence(string text1, string text2) { int len1=0; len1=text1.length()+1; int len2=0; len2=text2....
rushabhvg's user avatar
2 votes
1 answer
434 views

I have a problem to calculate parent account balances. In the database there are two tables: account and monthly_balance. In the monthly_balance table we store only leaf account balances, but I have ...
Gabor's user avatar
  • 73
0 votes
1 answer
104 views

I am given a grid or n * n. I need to find how many routes I can take to get from grid[0][0] to grid[n - 1][n - 1]. However in the grid there will be the letter 'H' in some of the spaces. If there is ...
Erin Yeh's user avatar
3 votes
2 answers
1k views

I am new to dynamic programming (and C++ but I have more experience, some things are still unknown to me). How can I add LIMITED COINS to the coin change problem (see my code below - is a bit messy ...
Alin M.'s user avatar
  • 43
0 votes
1 answer
1k views

def knapSack(A,L,R,K,N,Sum): if(K==0): if((L>=Sum)or(R<=Sum)): return 1 else: return 0 if((N==0)and(K!=0)): return 0 else: ...
Arun kumar's user avatar
0 votes
1 answer
95 views

I am trying to implement a Fibonacci function in Swift 5. While I was implementing the function on Xcode Playground (I took the code for the function from CSDojo's youtube video), I was encountered ...
Junsu Kim's user avatar
  • 395
0 votes
1 answer
205 views

I want to display text on the text box that says if I hit and how much damage I do and vice versa for the enemy, but I just can't figure out how to make the text to display in this manner. Here is the ...
Dannidona's user avatar
1 vote
2 answers
184 views

I'm trying to come up with a DP solution to Moons and Umbrellas from Code Jam's Qualification Round 2021. Below is my working recursive solution, based on their analysis: import sys from functools ...
planetp's user avatar
  • 16.6k
2 votes
0 answers
536 views

as far as I know (read) about generating LR-Parsing tables is that the columns (= token), where the reduce-action is written into a cell for a certain state, depends on the Terminals, that are in the ...
von spotz's user avatar
  • 925
0 votes
1 answer
109 views

I tried solving this question and the answer comes out to be option c. But in few textbooks answer given is option b. I am confused what would be the correct answer? Plz help me out!
Sinchit Batham's user avatar
0 votes
1 answer
553 views

I am trying to understand what is the relationship between L-attributed grammars and computing attributes during bottom-up parsing. Is it always possible to compute all attributes during syntax tree ...
SimpleName's user avatar
0 votes
1 answer
324 views

I've seen a comparison between sizes of parsing tables constructed for ambiguous and unambiguous grammar (of the same language). The one created for ambiguous was significantly smaller. The used ...
SimpleName's user avatar
9 votes
2 answers
244 views

I have n points and have to find the maximum united area between k points (k <= n). So, its the sum of those points area minus the common area between them. ]1 Suppose we have n=4, k=2. As ...
Michael.leaves77's user avatar
1 vote
1 answer
686 views

I was reading through this LeetCode article on a common algorithm problem, "Longest Common Prefix." They show a few different approaches, but my question pertains to just "Divide and Conquer." Its ...
James's user avatar
  • 4,747

15 30 50 per page
1
2 3 4 5 6