2015年12月15日星期二

Data Structure -- 1. String & Array

String and Array are sequential data structure with index and direct access. String is a fundamental representation in program and can be converted to various other structure like Array, linked list. So often a string algorithm becomes array algorithm The classic example is strStr Serialization is a useful concept LongestPalindromSubstring There could be an array of string/substring CompareVersionNumber LongestCommonPrefix String carries a lot of coding details like RegularExpression matching SimplifyPath Text Justification. This is tricky for the match calculation Array algorithm is not difficult, but needs drawing a picture to ensure index are manipulated correctly. Rotate image Spiral Matrix Interesting algorithm also exists

没有评论:

发表评论