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
Paladinen [302]
3 years ago
11

Write a recursive method to reverse a string. explain why you would not normally use recursion to solve this problem

Computers and Technology
1 answer:
Studentka2010 [4]3 years ago
3 0
Here's a Python program:

#!/usr/bin/python

import sys

def isPalindrome( string ):
    if( len( string ) < 2 ):
        return True
    elif( string[ 0 ] == string [ -1 ] ):
        return( isPalindrome( string[ 1: -1 ] ) )
    else:
        return False

if( __name__ == "__main__" ):
    print isPalindrome( sys.argv[ 1 ] )


You might be interested in
Higher Order Functions used for simulations of dice rolls. Definition: An n-sided dice function takes no arguments and always re
tiny-mole [99]

Answer:

#include <iostream>

#include <time.h>

#include <string>

using namespace std;

int main(){

srand(time(NULL));

cout<<"Throw dice"<<endl;

int b =0;

int a=0;

a=rand()%6;

b=rand()%6;

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

{cout<<"dice one: "<<a<<endl;}

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

{cout<<"dice two: "<<b<<endl;}

if(a>b)

{cout<<"first dice won"<<endl;}

if(b>a)

{cout<<"second dice won"<<endl;}

else{cout<<"they are same"<<endl;

return main();

}

return 0;

}

Explanation:

/*best dice roll game just for you change it as you want but all necessary things are there/*

5 0
3 years ago
What are the benefits of using presentations to organize and deliver information?
bearhunter [10]
Hello.

The benefits of using presentations to organize and deliver information are: it keeps things in order, keeps peoples attention longer, and it looks more professional.
4 0
3 years ago
Fill in the blanks:In the context of cyber security, social engineering (SE) is a deceptive practice that exploits human _______
lord [1]

Answer:

In the context of cyber security, social engineering (SE) is a deceptive practice that exploits human <u>weaknesses </u>  by inducing victims to interact with a digital device in a way that is not in their best interest. Many of these attacks begin with<u> spam</u> , which is defined as unsolicited messages that are usually sent in massive numbers using electronic mail systems. A spam  <u>filter</u> uses a set of rules to examine email messages and determine which are spam. There are four common types of spam filters.<u> Content  </u>filters examine the content within a message for certain words or phrases commonly used in spam emails.<u> Header</u> filters review the email header for falsified information, such as spoofed IP addresses. <u>Blacklist</u> filters block mail that originates from IP addresses of known spammers. <u>Permission </u>                    filters block or allow mail based on the sender's address. <u>Phishing</u> is an email scam that masquerades as a message from a(n) legitimate company or agency of authority, such as the IRS. <u>Pharming</u> redirects Web site traffic to fraudulent Web sites that distribute malware, collect personal data, sell counterfeit products, and perpetrate other scams. A rogue <u>antivirus </u>                exploit usually begins with a virus warning and an offer to disinfect the infected device. Some software is not exactly malware, but it is a nuisance. A <u>PUA </u>takes up residence on a digital device and seems impossible to disable or remove.

3 0
3 years ago
The more _____ a thumb drive has, the more storage capability it will provide. Hertz, bytes or pixels. The more _____ a micropro
beks73 [17]

Answer:

a) bytes

b) hertz

c) 1) hertz  and 2) bytes

Explanation:

A byte is the basic unit of information and data stored in a computer storage.  Hence, the storage capability of a drive will be measured in Bytes. On the other hand speed of processor is measured in terms of number of cycles made per second i.e hertz. Hence, the higher the value of hertz the higher is the speed of the computer.

5 0
3 years ago
To delete unnecessary files on a hard disk use?
charle [14.2K]

step by step

1. Open the Disk Cleanup by clicking Start, point to All Programs, point to Accessories, point to System Tools, and then click Disk Cleanup. Disk Cleanup will then calculate how much space you will be able to free on your hard drive.

2.Select the files by clicking the check box that you would like to delete (e.g. Downloaded Program Files and Temporary Internet Files) and click OK

3. Click Yes to confirm performing these actions.

To read the description of the particular program file, click the appropriate file and the file description is displayed at the bottom. If you want view the files on the particular program file (e.g. Downloaded Program Files and Temporary Internet Files), click View Files.

4. Click More Options tab to free up more space on Windows components, installed programs or System Restore. Click Clean up


8 0
4 years ago
Other questions:
  • A pacing calendar is provided to students so they can:
    8·2 answers
  • How to find the biggest files on your computer?
    10·1 answer
  • Which of the following statements best reflects the usefulness of commercial digital editing programs?
    7·1 answer
  • Which type of software is the most similar to database software?\
    5·1 answer
  • You want to figure out how much your next paycheck will be. You worked 80 hours and you make $12.50 per hour. You enter the numb
    15·1 answer
  • Why is it a good idea to defrag your hard disk regularly?
    9·1 answer
  • What G-Suite Apps integrate with Forms
    14·2 answers
  • HELP!!!!!
    7·1 answer
  • What are the main dimensions of information system and their components
    13·1 answer
  • Which step do you think is most useful from big data life cycle.why?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!