Блог пользователя Dontugiveup

Автор Dontugiveup, история, 3 года назад, По-английски

Lately I've started to practice 2000 rating questions. Ofc this is not my real account. Whenever I'm picking up a problem lately, I'm unable to do that and feel quite directionless. I now have started to try for like an hour or something. But often I feel clueless, so I see the editorial, but often I don't even editorials too. What should I do here? Should I think more and more even if I'm clueless? Should I not read the editorial at all for atleast a day? How do you do a problem where you feel very lost and clueless? Do you see the editorial or keep on giving your mind to it for long? Some more description on how I practice: I take randomly and my max is around 1700.

Please be polite. I know this question might have been frequently asked, but they weren't as specific for me. thanks in advance :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • -21
  • Проголосовать: не нравится

Автор Dontugiveup, история, 3 года назад, По-английски

I understand that memoization creates stacks and it slows down the speed, but how? and when I shouldn't use memoization? How should I asses that memoization will fail or pass for sure. In a problem, I used memoization, it got me a tle, but then i did the same code, just except i didnt pass the vector reference, instead of this I declared the vector globally and it passed, I dont know why it happened. Since I'm kind of noob in dp now, I've been thinking to execute in both ways: memo and tabular. I reckon that memoization does the same or less number or operations than tabular.

It would be really helpful if you explain me some rte or tle stuff in memoization and why it slows down when stacks increase?

thanks in advance :)

Update: would feel better if i got some helping answers along with downvotes if it makes no sense to you guys.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

Автор Dontugiveup, история, 3 года назад, По-английски

I am wondering for a site or a list or ladder...such that it has topic wise questions and there shouldnt be too many questions. There should be limited number of questions on a specified topic, such that doing them will make sure that one has got a good grip on that topic. Like questions should go from easy to hard.

Thanks in advance :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • -11
  • Проголосовать: не нравится

Автор Dontugiveup, 3 года назад, По-английски

I reckon that the graphs that can be colored using only two colors are bi-partite. Now, if we talk about a graph:

  1. suppose it is not a bi-partite graph...and we wanna see it through dfs..

if it's not bi-partite then the following image condition will be available in the graph atleast once:

https://ibb.co/zSSRBh9

so as we reach any vertex amongst those and mark it with a color, and reach any other vertex and then other vertex then there surely will be a color contradiction (two adjacent vertices with the same color)

hence this will give the result as false.

  1. since if the graph is not bipartite then it would cause a color contradiction and vice versa...hence if there's no color contradiction it is going to be a bipartite graph.

Am I thinking it the right way? or Am I missing out on something?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

Автор Dontugiveup, история, 3 года назад, По-английски

I kind of feel that it does, but I've not been able to convince myself that it does. How can I make myself sure about dfs traversing every node?

help me having the view to look at it.

Surely could be a naive question, but any help is appreciated :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится