All Questions
Tagged with compression strings
22 questions
2
votes
2
answers
246
views
Byte Pair Encoding Compression in C89
This is a small project to implement Philip Gage's Byte Pair Encoding compression for the purpose of learning C. In particular, it's written in C89 for fun as that's what would've been contemporary (...
1
vote
3
answers
175
views
Run-length coder
I have this code, which counts only adjacent letters in a string and returns the count of each letter.
...
2
votes
2
answers
455
views
Numeronym generation
Problem statement
I need to generate numeronyms from a string, let's say qwerty as follows:
qwerty
q1erty
q2rty
q3ty
q4y
Code
...
2
votes
2
answers
355
views
Naive string compression
Description:
Implement a method to perform basic compression using counts of repeated characters. If the compressed string is not smaller then return the original string.
Code:
...
1
vote
2
answers
2k
views
C++ huffman encoding - constructing encoded bytes efficiently
I've written a huffman compression program that works as intended, however in order to intuitively lay out the processes required to write the compressed file, I used strings in critical functions ...
-1
votes
2
answers
3k
views
Basic string compression implementation in C [closed]
I tried to implement a string compression algorithm that is mentioned in CTCI-5th 1.5 using C.
Does this code follow common best practices?
Performance and correctness in unanticipated cases of this ...
6
votes
2
answers
8k
views
Program to compress a string of characters
I was given this small task in an interview recently. I'm usually terrible at coding questions in interviews, because with the time constraint and the lack of google I usually overthink and rush stuff ...
6
votes
2
answers
7k
views
Perform basic string compression using the counts of repeated characters
I managed to implement this question from Cracking the Coding Interview:
Implement a method to perform basic string compression using the counts
of repeated characters. For example, the string <...
3
votes
2
answers
10k
views
Simple string compression in Python
This is my solution to exercise 1.6 in Cracking the Coding Interview. I am interested in receiving feedback on the coding style and time/space complexity.
The exercise statement is:
Implement a ...
3
votes
2
answers
6k
views
String compression implementation in C
I implemented basic string compression algorithm that uses the counts of repeated characters. For example: the string aabcccccaaa would become a2b1c5a3. What do you think about this, is there a better ...
13
votes
4
answers
4k
views
Algorithm for Run Length Encoding - String Compression
I attempted a problem from the Cracking the Coding Interview book. The following input: aabcccaaa should give the following output: ...
7
votes
4
answers
5k
views
String compression by using repeated characters count
My task was to perform a basic string compression by replacing consecutive repeated characters by one instance of the character and integer denoting the number of repetitions.
For example the string "...
5
votes
3
answers
1k
views
Compress an ASCII string
Given an ASCII string create a 'compressed' version of it. For example, aabccccddddddde would output a2bc4d7e whereas abc would output abc.
This is how I've implemented it. Is there a smarter way to ...
3
votes
2
answers
2k
views
String compression using repeated character counts
Implement a method to perform basic string compression using the counts of
repeated characters. For example, the string aabcccccaaa would become
...
2
votes
2
answers
6k
views
Evaluation of a solution for Run-length encoding algorithm
I wrote an answer for the following question and wondering if there is any better approach to it.
Using the Java language, have the function RunLength(str) take ...