complexidade-de-algoritmo

How to measure the complexity of an algorithm?

I need to know if my algorithm meets the demand of the following statement: Implement an algorithm with O(n) complexity ... d) { int n; scanf("%d", &n); printf("%d\n", fatorial(n)); return 0; } If possible explain how to make the measurement.

What is the NPI complexity class?

Studying about complexity, I came across the term NPI. It means NP-intermediate. But I did not understand what this "intermed ... er ): NP : non-deterministic polynomial P : polynomial deterministic NPC : NP-Complete NPI : NP-Intermediate

Cycles in graphs

I am creating an algorithm that identifies if a Graph contains cycles deleted sources recursively, returning the graph for la ... k it by topological numbering, applying a DFS, I wanted to run it using the DFS of another way, without this check, Have how?

Algorithm and complexities

If I build an algorithm with complexity of worst case Theta of n^2 can I have as a counterpart a complexity of best case for this algorithm with big O n^2?

Which code has a higher cost? (Bubblesort in C)

void bubblesort(int *A, int n) { int i, aux; for(i=0; i<n-1; i++){ if(A[i]>A[i+1]){ aux = A ... e cost of each line. PS: If anyone has a hint of calculating the cost and complexity of recursive algorithms, I'll be happy.

Problem of the Byzantine Generals. How to implement a solution?

Initial considerations I'm doing some research on Bitcoin and bumped into the concept of the problem of the Byzantine Genera ... itcoin : A Peer-To-Peer Electronic Cash System. Available in: https://bitcoin.org/bitcoin.pdf >. Access on: 03 Jan. 2018.

Doubt in the extraction of the recursive Fibonacci recurrence equation

In some materials on the internet, I found this algorithm to extract the equation of recurrence from the recursive factorial: ... shows 1 + T(n-1) + T(n-2) and yes T(n-1) + T(n-2). Does anyone know how to tell me what the correct form and why? Thank you!

How to prove the asymptotic order of an algorithm?

Considering an algorithm like the one below: function somaMatriz(matA, size) { let soma = 0; ... from a book). For example, even to try to standardize the possible answers, such as proving that: 5n2 + 3N ∈ O (n2)

What is the difference between" Big O"," Big Theta "and"Big Omega"?

What is each of these "Big O", "Big Theta" and "Big Omega" for and when to use each to describe the complexity of an algorithm?

Big O notation-complexity O (log n)

I have some questions about this complexity, which base is used in this logarithm, 2 or 10? and why? Searching google I saw s ... entially, the search grows only linearly, would it be enough to understand all other cases of complexity involving logarithm?

What is the complexity of an algorithm?

What is the complexity of an algorithm? And what are the ways to measure it? (Big O, Big Theta...)

BubbleSort complexity calculation

I would like to know how I can demonstrate by calculation induction the complexity of the bubblesort algorithm, both in the b ... i] = alist[i+1] alist[i+1] = temp alist = [54,26,93,17,77,31,44,55,20] bubble_Sort(alist) print(alist)

What is a complete NP problem?

What is a complete NP problem? What examples can be given to illustrate a complete NP problem? Why are these problems considered important?

Ordering with certain condition

I asked the question who will be reproached? that had the rule the students would be ordered according to the number of prob ... pessoa[i].nota = pessoa[j].nota; pessoa[j].nota = aux; } } } } }

What is the master theorem?

What is the master theorem? What is its importance in algorithm complexity analysis?

What is an optimal algorithm?

I'm taking classes from Introduction to complexity analysis. I was told that an example of an optimal algorithm is the algor ... ; } } what is an optimal algorithm? Why is this algorithm great? and how to determine if other algorithms are great?

Definition Notation " Little-O ")

I would like to understand a little better about the Little-O notation, it is for academic purposes, but I have not found eno ... ntent or in a slightly more "clear" way, for understanding. I am a little lost in relation due to lack of material for study.

Eliminate cycles in graph by removing fewer vertices

I would like to know if anyone knows if it is possible to eliminate all cycles of an undirected graph (n vertices) without weights, by removing the fewest vertices, in time O (n2) ? Note: the graph can be complete, at worst.

Best worst case sorting algorithm

I want to know which algorithm performs best when dealing with its worst case compared to others each dealing with its own wo ... s accepted but also the factor of this term in the formula of comparisons or experimental measures of time in large problems.