souravsain
BAN USERMy Company: General Eelctric
@netappreject,
How do u create a suffix tree of the patters here? Where are patters? T is just a set of characters...please explain.
Well some more thoughts are needed. We cannot simply discard first x2, we can have the buildings like (2,20,50),(4,7,80),(8,12,40). Here first building is so broad that it is having the other end after all other buildings!...
Need to take this also into account.
Sort the given set of buildings (x1,x2,height) on x1 in ascending order. Now draw a vertical line from first item of the sorted buildings at x1, vertically up of Height "height" given in first item of the sorted items. Them keep drawing a horizontal line and move right (I am asuming X-Y coordinates in first quadrent). While you draw the horizontal line, keep incrementing x (which was equal to x1) and keep checking if x=x2 or x=x1 of second item of sorted buildings. If x=x2, move vertically done, if x=x1 of second building (there is overlap of two buildings) discard previous x1 and use this new x1 and continue.
- souravsain August 15, 2010
@ftfish,
- souravsain August 25, 2010In the example being discussed, we are saying
string: acccabeb
pattern: ab
But in the question T = Set and so T={'a','b'}
hence if string is string: bacccaeb, your smallest window is [1,2], i.e. occurrance of all elements of T (order does not matter).
Let me know if you aggree and if yes, "Left most border of pattern" needs more thought.