Questions tagged as 'algoritmo'

2
answers

Bogosort - what is this?

What exactly does the bogosort sorting algorithm do? Why do many people say that it is inefficient?     
asked by 26.06.2016 / 16:05
1
answer

How to calculate the median when the data is in chunks?

Suppose my data is divided into 2 vectors: x <- c(100, 400, 120) y <- c(500, 112) I could calculate the median, joining the two vectors and then using the median function. median(c(x,y)) [1] 120 Suppose for some reason I c...
asked by 30.12.2016 / 02:08
3
answers

Reverse a 3-digit number in C

I need to make a program that the user type a three-digit number and the program reverses that number for example 123 -> 321 , I would like to know the logic to do this, because I can not think of anything.     
asked by 15.10.2014 / 19:48
3
answers

Mathematical Combinator

I have a list of ex numbers: [1, 2, 3, 4] I need to know all the possible combinations of this list, remembering that the list can contain n elements, does anyone have any code examples or could you help me? For this example list the exp...
asked by 01.10.2014 / 13:51
2
answers

Infinite loop trying to calculate whether the number is prime

I have no idea how I will determine the condition of for for prime numbers. I always end up in looping . #include <stdio.h> int main() { int num = 1, primo; do { printf("Informe um numero primo maior qu...
asked by 06.09.2015 / 06:07
1
answer

What happens if a binary search does not find the element?

What happens if a binary search does not find the element? Does it enter loop ? What is the best way to end execution?     
asked by 23.11.2017 / 02:52
2
answers

Doubt about algorithms of ordering in constant time

I need to solve a exercise with the following statement:    As input we have a vector of n elements, where each element has a value between 0 and k . In addition we have two integer values a and b . We must answer how many elements in...
asked by 28.04.2014 / 00:18
2
answers

Base62 encoding

I'd like to know where I can get some PHP implementation, similar to PHP's MIME Base64 but only contain the A-Z, a-z, and 0-9 characters. PHP Base64 is quite versatile, but I need an algorithm that does not include the characters +...
asked by 16.01.2015 / 16:12
1
answer

Recursive function that simulates a number raised to a power

How to simulate raising a number to a power using recursion (and Python)? '     
asked by 06.01.2015 / 17:54
2
answers

How to identify a specific number in any numeric value?

For example, my variable valor has the value 1354 , note that 13 appears in this numeric value . How can I identify a specific number in any other numeric value? I would like an example in C. The following is the problem stateme...
asked by 30.08.2015 / 01:33