Pergunta de entrevista da empresa Microsoft

How to would you find out whether a substring occurs in a given string?

Respostas da entrevista

Sigiloso

10 de ago. de 2011

If the query string isn't going to change that often, then it might be a hint to use KMP. Since it creates a "matching-table" for all the characters in the query string - so irrespective of the text we are going to be searching in and given that the query string doesn't search that often KMP can provide an O(n) solution.

Sigiloso

20 de out. de 2010

Complexity? What is best way to deal with it if the query string change not often?

Sigiloso

13 de jan. de 2011

this query is follows............ UPDATE tablename SET colm1=(@temp:=colm1), colm1=colm2,colm2 = @temp;