Analysys of uncompess on input of length N words (where each line is bounded by 40 words max -> max 80 chars per line, which would be worst case would be alternating alpha's separted by spaces: Q | #Q | time Q | #A | time A | total ------------------------------------------------- look-up: 1 | 1 | O(1) | 1 | O(1) | O(1) 2 | 1 | O(1) | 1 | O(1) | O(1) ------------------------------------------------- | | | | | O(1) Add-to-Book: 1 | 1 | O(1) | 1 | O(1) | O(1) 2 | 1 | O(1) | 1 | O(80) | O(1) 3 | 1 | O(1) | 1 | O(1) | O(1) ------------------------------------------------- | | | | | O(1) compess: [same as compress-first] (per one line of characters): Q | #Q | time Q | #A | time A | total ------------------------------------------------- 1 | 80 | O(1) | 1 | O(1) | O(1) 2 | 80 | O(1) | 80 | O(1) | O(1) 3 | 80 | O(1) | 80 | O(1) | O(1) 4 | 80 | O(1) | 80 | 0(1) | O(1) 5 | 80 | O(1) | 1 | O(1) | O(1) 6 | 1 | O(1) | 1 | O(1) | O(1) ------------------------------------------------- Multiplied by maximum number of lines-> | O(1)*O(N) | | | | | =O(N)