Pregunta de entrevista de Microsoft

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

Respuestas de entrevistas

Anónimo

10 ago 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.

Anónimo

20 oct 2010

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

Anónimo

13 ene 2011

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