algoritmo

How to provide a specific amount of strings to be tested?

I can test whether a string provided by the user is a palindrome or not (word or phrase that can be read from back to front i ... = stringTodaMinuscula[::-1] if stringInvertida == stringTodaMinuscula: print "SIM" else: print "NAO"

How to remove characters from a string?

The program must read Two strings and remove from the first string all the letters that occur in the second string. Example: ... raw_input() string2 = raw_input() stringresultante = caracteres da string1 - caracteres da string2 print stringresultante

Algorithm for distributing entries from an encyclopedia based on number of characters per day

I have generated a list of entries from an encyclopedia and I want to find the best way to separate the entries so that I cho ... ut I am not being able to adapt it for this script. See: What algorithm to distribute the paragraphs? How could I do that?

Algorithm for calculating life time in days

I wanted to know how many days I have lived, from the date I was born to this day, including leap years. I'm doing the follow ... s += 366; } else { totaldias += 365; } } printf("Dias: %d",totaldias); return 0; }

Best algorithm for calculating factorial

So, I'm learning to develop in Java. The professor asked me to develop a method for the factorial. And also show on the scree ... io inserir o número) 6 -> lblFat (local que gera o resultado) Factorial in Java, do you have a better way to write code?

Algorithm in C to convert Arabic number to Roman Number

How to do this conversion? Does not need to be the algorithm ready, wanted a help at least in logic.

How to make a phonetic algorithm for Brazilian Portuguese?

To facilitate the search for commonly misspelled information, we use phonetic algorithms. A feature that is extremely useful ... something better can still come up and I am willing to change the acceptance if this occurs. I still want to see your answer.

Queue implementation in ANSI C

I have a code (end of question) that allows manipulation of a queue in ANSI C, my question is as follows: the code declares a ... ont(Q)); Enqueue(Q,5); Dequeue(Q); Enqueue(Q,6); printf("Front element is %d\n",front(Q)); }

Algorithm for finding common word sequence

I'm looking for a logic where I can find in an exorbitant amount of data, sentences that are common. Sentence In this conte ... would be Orlando do On Searching I found this question in StackOverflow en entertaining I could not understand the answer.

How to make an MDC algorithm with only sum and subtraction?

How do I make an algorithm that calculates the MDC of two numbers using only addition and subtraction operations? It is forbidden to use operators other than those requested.

Graph Search to solve euler's theorem

Hello, I would like a help to do a search on a graph and check if it satisfies euler's theorem. The theorem says: " a connec ... check as much as possible each of my neighbors in the graph. In what other ways can I optimize this my solution suggestion?

How to create an indeterminate algorithm using visualg?

I need to create an algorithm that returns me different values each time it runs, even getting the same input values. Aims t ... hat calculates its generations as long as it has children, and says that it has gone extinct when there are no more children.

Algorithm for cutting plane

I do not know if this is the best place to ask this question, but I searched a lot on the internet for some algorithm for cut ... the best arrangement so that it disperses as little as possible. Does anyone know of any algorithms close to this reality?

How to print multiples of N in a range?

The program should receive as input three values N, A, and B, and should print the multiples of N contained in the interval b ... uld print 'nonexistent', if the entries were, for example, 12, 1 and 10, where there are no multiples of 12 between 1 and 10.

How to make a variable of type character receive another in a conditional structure in VisualG?

I'm making an algorithm to show the highest grade and in that highest grade,show the name of the student who took that highes ... FimSe FimEnquanto Escreval ("O melhor aluno da sala foi ",Melhor_aluno," com a nota de ",maior," pontos") fimalgoritmo

How does the Des algorithm work?

I am in doubt about how the Data Encryption Standard works, could anyone explain in a didactic way?

Simple solution for Fibonacci algorithm

I have this statement in my hands: Given the Fibonacci Sequence 1 1 2 3 5 8 13 ... n, Write an algorithm to generate the ... = n2; n2 = n3; qtd--; } System.out.println("Fim"); } } Have a better solution for this algorithm?

Is there insertion method for Binary Tree Search faster than trivial?

I'm trying to solve this problem in an online judge. The problem provides N integers that must be inserted, in the given o ... printf("%d ", father[in[qi]]); } scanf("%d", &qi); printf("%d\n", father[in[qi]]); } Appreciate any help=)

Factorial algorithm in Portugol Studio

I have this algorithm: programa { inteiro numero, fatorial, resultado=1 funcao inicio() { escreva (" ... } Which correctly returns the factorial to me. But how do I get him to return all the math? EX.: 5! = 5x4x3x2x1=120

How to do table test for certain algorithm?

I have this algorithm, in a pseudocode: Knowing that n1 gets the value 20. inicio inteiro: n1,n2,n3; leia (n1); n2<- ... ng: N2 (receives result) of n1 * 3 (20 times 3) How to do a table test to find the result of this algorithm above?