1. Engineering
  2. Computer Science
  3. considering two cases please write program for 1rst question ...

Question: considering two cases please write program for 1rst question ...

Question details

Considering Two Cases Please write program for

1rst question )

Given a string "aaabbbcc", compress it, = "a3b3c2" . Given that output string's length is always smaller than input string, you have do it inplace. No extra space like array should be used.

2nd Question)

Given a string "aaabbbcc", compress it, = "3a3b2c" . Given that output string's length is always smaller than input string, you have do it inplace. No extra space like array should be used.

Please write a very simple Java and C++ program to explain the logic of both the questions . I want to know how to do the program in both C++ and java . I am not clear with the concepts and getting confused. Hence i beg you please provide me correct program of both the QUESTION and write program in C++ and JAVA BOTH

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution