We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Searching for a pattern in a compressed file traditionally involves uncompressing the file on-the-fly and performing a regular search. On occasion it will be possible to compress the search pattern instead and to search for the compressed pattern in the compressed file. When possible, this is a double win since compressing the smaller search pattern is quicker than decompressing the file, and the pattern-matching itself is quicker as search-time is proportional to the file-size
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Prefix Compression
You are viewing a single comment's thread. Return to all comments →
Searching for a pattern in a compressed file traditionally involves uncompressing the file on-the-fly and performing a regular search. On occasion it will be possible to compress the search pattern instead and to search for the compressed pattern in the compressed file. When possible, this is a double win since compressing the smaller search pattern is quicker than decompressing the file, and the pattern-matching itself is quicker as search-time is proportional to the file-size