15,505,126 members
Home / Discussions / Algorithms

# Algorithms

 AI: how to distinguish music from voice David_Spector20-Jul-20 3:25 David_Spector 20-Jul-20 3:25
 Re: AI: how to distinguish music from voice Gerry Schmitz23-Jul-20 4:55 Gerry Schmitz 23-Jul-20 4:55
 Re: AI: how to distinguish music from voice David_Spector23-Jul-20 5:21 David_Spector 23-Jul-20 5:21
 Right approach for Dynamic Programming Member 1487381426-Jun-20 14:20 Member 14873814 26-Jun-20 14:20
 Hey there. So as my final in algorithms is getting closer, I'm trying to scrutinize some DP problems from past tests. Input: A list L of strings, and another string s. Output: "yes" if s is a concatenation of string from L, "no" otherwise. Example: AGAGADIR is a concatenation of strings from the list {ADI, AG, R, SI}; but the string SIRA is not. Assume that checking if a string is contained in L costs O(1). Also, notice the option of an empty string. My way of thinking about DP solution: The aim is initially to define the right sub-problems of the main problem, and then to develop the right recursion with the suitable memoization. Sub-problems: we'll look at the string s up to the char at index i (between 0 and Length(s) - 1) and decide if it's itself a concatenation of strings from L. Recursion: if i == 0 then the empty list is trivially in L, continue to i = 1; if i == 1 then go over the list L and compare if there is a char element in L which equals to the first character of s - if not, check for i=2, otherwise... here I'm stuck Can someone please direct me? Give me some sense for DP? Thanks in advance.
 Re: Right approach for Dynamic Programming Patrice T29-Jun-20 12:26 Patrice T 29-Jun-20 12:26
 Re: Right approach for Dynamic Programming Richard MacCutchan29-Jun-20 22:50 Richard MacCutchan 29-Jun-20 22:50
 Re: Right approach for Dynamic Programming Gerry Schmitz30-Jun-20 16:13 Gerry Schmitz 30-Jun-20 16:13
 Re: Right approach for Dynamic Programming Luc Pattyn5-Jul-20 4:40 Luc Pattyn 5-Jul-20 4:40
 what is being done in this algorithim Muhammad Sudais26-Jun-20 9:40 Muhammad Sudais 26-Jun-20 9:40
 Re: what is being done in this algorithim Dave Kreskowiak26-Jun-20 10:06 Dave Kreskowiak 26-Jun-20 10:06
 Re: what is being done in this algorithim Richard MacCutchan26-Jun-20 23:19 Richard MacCutchan 26-Jun-20 23:19
 Dynamic Programming / Greedy algorithm - Best time with constraints Member 1487381426-Jun-20 2:04 Member 14873814 26-Jun-20 2:04
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Richard MacCutchan26-Jun-20 0:18 Richard MacCutchan 26-Jun-20 0:18
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Member 1487381426-Jun-20 0:30 Member 14873814 26-Jun-20 0:30
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Richard MacCutchan26-Jun-20 0:43 Richard MacCutchan 26-Jun-20 0:43
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Greg Utas26-Jun-20 1:42 Greg Utas 26-Jun-20 1:42
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Member 1487381426-Jun-20 2:00 Member 14873814 26-Jun-20 2:00
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Greg Utas26-Jun-20 2:41 Greg Utas 26-Jun-20 2:41
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints harold aptroot26-Jun-20 2:15 harold aptroot 26-Jun-20 2:15
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints Member 1487381426-Jun-20 2:19 Member 14873814 26-Jun-20 2:19
 Re: Dynamic Programming / Greedy algorithm - Best time with constraints harold aptroot26-Jun-20 3:54 harold aptroot 26-Jun-20 3:54
 Last Visit: 31-Dec-99 19:00     Last Update: 1-Dec-22 23:10 Refresh ᐊ Prev1...6789101112131415 Next ᐅ