Questions tagged as 'algoritmos'

1
answer

Dekker Algorithm for 3 processes is blocked

Good morning, I want to implement the famous Dekker Algorithm to solve the problem of mutual exclusion for 3 processes instead of 2. I have 3 processes, P, Q and R, each process has its Boolean variable indicating if it wants or Do not enter the...
asked by 18.11.2016 / 16:51
0
answers

How to decode adaptive huffman?

I am trying to decompress what would be a PNG file, I have come to the part of obtaining the data already compressed from the IDAT section, as I understand these data are decoded in an Adaptive Huffman, I have already researched in certain pages...
asked by 05.12.2018 / 18:13
0
answers

Algorithm Game Pseint

I find myself playing a game for academic purposes. Which consists of two players where the main objective of the game is to reduce the opponent's life to 0 in order to determine the winner. The game consists of turns where each opponent wil...
asked by 20.06.2018 / 03:21
2
answers

How to get a random number with decimals and integers in JavaScript?

I can get random numbers in a custom range, with: Math.floor(Math.random() * ( maximo - minimo + 1 ) + minimo ) Example: var max = 10, min = 4, random = Math.floor(Math.random() * (max - min + 1) + min); console...
asked by 16.01.2018 / 04:08
2
answers

Incorrect operation of a character counter within strings in Python

Suppose I have the following sentence: oracion = 'Mi perro bonito come todas las noches' And I want to create a function that tells the occurrence of each character within it. To that end, we import string and create an alphabet that is our...
asked by 12.10.2017 / 07:21
1
answer

how can I "extract" from a string in C using fscanf?

I want to use fscanf () as a filter, for example if I do the following with a record with two fields, the first field is "ignored" and it reads the second field fscanf(fd, "%*d, %d", &numero) As I would if I want to read a part of the c...
asked by 17.10.2017 / 05:04
0
answers

How can I continue entering values to my Binary Tree?

Good, in this code implement a binary tree where values are entered and performing their respective operations. However, when wanting to enter more and more values, I am marked by an error that requires me to receive some advice on what can be d...
asked by 18.04.2017 / 03:32
0
answers

MacKay Neal Algorithm - Stuffing a matrix with ones and zeros

I need to fill in a matrix with ones and zeros. The parameters that are provided are its dimension (N columns and k = N * (1-r) rows) and two vectors h and v that represent the distribution of rows and columns, respectively. For example, suppose...
asked by 16.03.2017 / 12:30
0
answers

Add two Arrays in the form of list and viseversa [closed]

I have the Arrays a and b a = [1,2,3] b = [15,25,35] and I have the variale v v = 36 where v is the sum of some of the combinations between a and b , that is (according to the example): v = a[0] + b[2] I know I have to add...
asked by 07.05.2017 / 05:14
0
answers

What should be known to use backtracking and divide and expire? [closed]

Really these two concepts are important in the programming, I really took little time in programming. I know that the two topics can be extensive to answer, but what I want to achieve is that in order to implement some of these two concepts...
asked by 19.12.2016 / 18:44