Skip to main content
Levon's user avatar
Levon's user avatar
Levon's user avatar
Levon
  • Member for 9 years, 5 months
  • Last seen more than 4 years ago
comment
Count all vowels in string
@Blindman67 Makes sense. Beginners will benefit from having this explicitly written :) Have a good one!
comment
Count all vowels in string
Although what you are saying is correct and it is nice to point that a better data structure could be used, an array in this case is not really O(n*m), because m is a constant (does not change with input) and does not impact in the asymptotical analysis Big Oh provides.
awarded
asked
Loading…
awarded
awarded
awarded
awarded
awarded
comment
Huffman algorithm implementation in C++
It does not matter what parameters I give to that function, it always returns 0. For example, if I call the function like this numToBin(10u,5u). Am I doing something wrong? :P
comment
Huffman algorithm implementation in C++
Are you sure it works? It does since num & (1 << shift) ALWAYS returns 0. I do not really know why it returns 0 every time, does not matter the number or what shift's value is
accepted
awarded
comment
Huffman algorithm implementation in C++
Thank you for answering! I just cannot get my head around move semantics so I use it when I feel to. I know this is not good practice but I felt like that would improve my code :/ . Also, what looked interesting since it could potentially speed up my algorithm was avoiding using reverse, however, the code that you put there does not work :P
asked
Loading…
awarded
accepted
comment
Checking for spelling errors with a trie
Thanks for answering! All of what you said worked flawlessly, again, thanks. After changing my code a little bit more, it now works with a capital letters and hyphens. Here's my code if you want to check it out I do believe there's some memory leaking somewhere, but I can't find where... Anyways, thanks!
asked
Loading…
comment
Solution to challenge of making a list
@nightuser code didnt compile since a typo error, re-edited and now it does