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
Degger [83]
2 years ago
14

You will be given a string, containing both uppercase and lowercase alphabets(numbers are not allowed).

Computers and Technology
1 answer:
murzikaleks [220]2 years ago
6 0

Answer:

The Java code is given below with appropriate comments

Explanation:

import java.util.*;

class Main {

   static Set<String> set = new HashSet();

   static void printPerms(char ch[], int ind){

       //If end of string is reached, add it to set

       if(ind==ch.length){

           set.add(new String(ch));

           return;

       }

       for(int i=ind;i<ch.length;i++){

           //Only swap if lower case

           if((ch[i]>='a' && ch[i]<='z')&&((ch[ind]>='a' && ch[ind]<='z'))){

               char t  = ch[i];

               ch[i] = ch[ind];

               ch[ind] = t;

           }

           printPerms(ch,ind+1);

           if((ch[i]>='a' && ch[i]<='z')&&((ch[ind]>='a' && ch[ind]<='z'))){

               char t  = ch[i];

               ch[i] = ch[ind];

               ch[ind] = t;

           }

       }

   }

   public static void main(String[] args) {

       printPerms("aBbCc".toCharArray(),0);

       System.out.println(set);

   }

}

You might be interested in
The range A2:B4 has how many cells?<br><br> Answers:<br> 2,4,6,8
mylen [45]
6 cells because you have to drag and it becomes six cells .

8 0
3 years ago
Read 2 more answers
Write a single statement that assigns avg_sales with the average of num_sales1, num_sales2, and num_sales3.
sammy [17]

Answer:

Explanation:

try numpy:

import numpy as np

print(np.average([3, 4, 8]))

output:

5.0

3 0
2 years ago
How would you print from 1 to 1000
Hitman42 [59]

Answer:

There are two ways to print 1 to 1000

  1. Using Loops.
  2. Using Recursion.

Explanation:

Using loops

for(int i=1;i<=1000;i++)

{

  cout<<i<<" ";

}

Using recursion

Remember you can implement recursion using a function only.

void print(int n)

{

  if(n==0)

  return;

  print(n-1);

  cout<<n<<" "';

}

you should pass 1000 as an argument to the function print.

5 0
3 years ago
Analyze the error in the html code :<br><br> HTML
Andrei [34K]

Answer:

The World Wide Web Consortium provide a simple online tool (https://validator.w3.org/) that automatically check your HTML code and point out any problems/errors your code might have, such as missing closing tags or missing quotes around attributes.

Explanation:

your question is not clear

hope it helps

6 0
2 years ago
after installing a second hard drive what needs to be done to the hard drive and what do these 2 tasks do?
PIT_PIT [208]
To make it useable, the disk first needs to be subdivided into logical volumes, then formate, so that it is readable by the systems.
6 0
3 years ago
Other questions:
  • Another important mode, XTS-AES, has been standardized by the __________ Security in Storage Working Group. a. IEEE b. ITIL c. N
    9·2 answers
  • What identifies available computers through the internet?
    14·1 answer
  • Judy forgot where she saved a certain file on her computer. Therefore, she searches for all files with a .jpg file extension. Wh
    10·2 answers
  • What are the two main functions of user accounts in Active Directory? (Choose all that apply.) Allow users to access resources m
    7·2 answers
  • On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * r^n, where n is the distance
    10·1 answer
  • You want to use a terminal program to terminal into a cisco router. what protocol should i use
    8·1 answer
  • How much is this worth in dollars​
    9·1 answer
  • A student can improve performance by decreasing
    14·1 answer
  • A program similar to mtr, ____, is available as a command-line utility in Windows operating systems.
    12·1 answer
  • What is the descriptor for a filter that warns or blocks you from potentially fraudulent or suspicious websites?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!