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

Автор aaryyann, история, 16 месяцев назад, По-английски

There is figure shows 6 connected components . why they have written there are 2 cyclic components . Because in diagram there are 3 cyclic components . please help to guide me.

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

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

Автор aaryyann, история, 18 месяцев назад, По-английски

for this problem can someone please tell where i am wrong ?? My thinking approach -----> if i find the length of LCS (Longest Common Subsequence) and then find Remain Length i.e. total — Lcs . after this i iterate over Patter (p) and if i found * i return true and if there is not any * we will take count of ? and subtract that with remaining length . Now if remaining length become 0 we return true else false ..

But this solution fails .... someone please explain why this wrong thinking ??

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

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