Posts by Marcos Martin • 55 points
4 posts
-
1
votes1
answer196
viewsQ: Doubt with the ternary operator
Which means the following expression: struct Node *temp = root->left ? root->left : root->right; I’m wondering if he’s checking the existence of the pointer root->left or comparing *temp…
-
2
votes0
answers324
viewsQ: Newton-Raphson method together with Horner
I’m having trouble implementing Horner’s method to decrease the computational cost of polynomial calculations and, having done so, using Newton’s method to find the root of the polynomial In the…
-
2
votes1
answer493
viewsQ: How can I set a range for a float?
Trying to implement Newton’s method for finding roots in polynomials, using Horner’s method. n=len(a)-1 print("k\t a\t x\t px") for k in range (0, iterMax): b=a[0] c=b for i in range (n-1,1):…
-
0
votes1
answer90
viewsQ: Stacks with sequential allocation
I’m having problems implementing the code of a stack using vectors: typedef struct pilha pilha; struct pilha { int *v; int topo; int tam_max; }; void Inicializar_Pilha (pilha pi, int tam_max) {…