1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
cricket20 [7]
4 years ago
7

Write a method called compress that takes a string as input, compresses it using rle, and returns the compressed string. case ma

tters - uppercase and lowercase characters should be considered distinct. you may assume that there are no digit characters in the input string. there are no other restrictions on the input - it may contain spaces or punctuation. there is no need to treat non-letter characters any differently from letters.
Computers and Technology
1 answer:
MaRussiya [10]4 years ago
5 0
<span>public static String compress (String original) { StringBuilder compressed = new StringBuilder(); char letter = 0; int count = 1; for (int i = 0; i < original.length(); i++) { if (letter == original.charAt(i)) { count = count + 1; } else { compressed = count !=1 ? compressed.append(count) : compressed; compressed.append(letter); letter = original.charAt(i); count = 1; } } compressed = count !=1 ? compressed.append(count) : compressed; compressed.append(letter); return compressed.toString(); }</span>
You might be interested in
HOW DO I HACK PUBG MOBILE WITH PROOF <br>GIVE ME LINK​
muminat

Answer:

why do u want to do that i have an acc i dont even use that is so good with so much uc and other skins on it

Explanation:

5 0
3 years ago
Read 2 more answers
By generating and delivering timely and relevant information supported by networks, _____ creates new opportunities for conducti
castortr0y [4]

Answer:

The correct option to the following question is option (B). e-business.

Explanation:

E-business is stands for the Electronic business.

E-business is the business which is conduct by the uses of the internet, Web, extranet or intranet, etc.

E-business is also known as the online business where online transactions take place.

E-business facilitates our customers that the selling and the buying of the goods between the consumers and the merchants.

7 0
4 years ago
The type of power that has the ability to call on connections and networks both inside and outside the organization for support
givi [52]

Answer: c) Connection power

Explanation:

Connection power is the power that is established personally in the field of business.A person having connection with powerful person personally outside or inside the organizational field then he/she can attain the desired goals or result through connecting with them, influencing powerful person's decision, getting their things done etc .

  • Other options are incorrect because association power, information power,coercive power and referent power are the power to establish connection organization to achieved aim.
  • Thus, the correct option is option(c)
5 0
3 years ago
Robots can obtain data from the environment, store the data as knowledge, and modify their behavior
TiliK225 [7]
True robots that have integrated ML can store data in specialized arrays which can be processed by the algorithms to give the output as their behaviour.
5 0
3 years ago
You are a very small company that sells healthcare insurance plans. You estimate that the breach of your customer database will
lozanna [386]

Answer:

C. Accept the risk

Explanation:

The first option is close but might not be suitable for a small company considering it's cost.

The second option which is to spend fifty thousand dollars per year on a data loss prevention solution is projected to cost you more than the risk.

The third option isn't specific and lacks a course of action.

6 0
3 years ago
Other questions:
  • g Write a program that prompts the user to enter two integers. The program outputs how many numbers are multiples of 3 and how m
    11·1 answer
  • How do humans acquire voltage in their bodies
    8·1 answer
  • I need help, please and thank you.
    7·2 answers
  • There are some processes that need to be executed. Amount of a load that process causes on a server that runs it, is being repre
    7·1 answer
  • Industrial property rights include​
    10·1 answer
  • An entity can be said to have __ when it can be wronged or has feelings of some sort
    10·1 answer
  • In your own words, describe invention.
    8·2 answers
  • Whats th diffence between a fwireless speaker and a wird speakr
    12·1 answer
  • Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.
    5·1 answer
  • Given the tables PRODUCT (ProductID. Description. Cost) SUPPLIER (Supplier D. ContactName, Phone Number) as shown in the figure
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!