Posts by Erik Jhonatta • 151 points
13 posts
-
0
votes1
answer752
viewsQ: Capybara Unable to find Visible field
When rotating the command rake cucumber i get the following error: Unable to find visible field "article[text]" that is not disabled (Capybara::ElementNotFound) But the field is visible File of…
-
0
votes1
answer469
viewsQ: How complex is the algorithm?
I’m learning how to calculate the complexity of algorithms using Big-O notation, but I’m having difficulties with the algorithm below: a=0 for(int i = n; i>0; i -=2){ for(int j = i+1;…
-
0
votes1
answer407
viewsQ: Read a text file and separate content into variables
I have a question about how to divide information from a text file into variables in C. Example, I have a txt file with the following data: 3 2 A D E AD DE I would like to read this file, and…
-
1
votes1
answer865
viewsQ: Recursive heapsort in C
I have a heapsort, and would like to implement it recursive. What I need to change in my algorithm? void criarHeap(int v[], int inicio, int final){ int aux = v[inicio];//v[pai]//inicio=pai int filho…
-
2
votes1
answer526
viewsQ: How to implement a Recursive Merge
I have a Mergesort algorithm and I would like to implement the merge function recursively, it is not the recursive Mergesort function but its Merge function. Here is the code for the Merge Function…
casked Erik Jhonatta 151 -
1
votes1
answer992
viewsQ: Insertion at the end of a chained list C
I would like to know how to go through the list so that I can add a new No at the end of it, in the case at the position no->Prox of the last in the present in the list. Here is my code: typedef…
-
1
votes1
answer65
viewsQ: Printar value of a struct by pointers
I want to print the "attribute" name of a "Person" type struct, but the printf returns (null) but I declare the struct name. Follow the code below: typedef struct pessoa{ char *nome; struct pessoa…
-
0
votes1
answer432
viewsA: How to change an attribute in a list of objects and write that list in a file
I solved the problem, thank you to all who helped. Here’s the solution I found to this problem. def adicionarQuantidade(self,consumivel): consList = self.carregarConsumiveis() for con in consList:…
-
0
votes1
answer432
viewsQ: How to change an attribute in a list of objects and write that list in a file
I have a list of objectsconList I want to change an attribute of an object and then write that list in a file, where each line of the file is an attribute of each object in the list. How do I do it…
-
1
votes2
answers2960
viewsQ: Elements in common between lists
How do I compare elements from 2 lists, and return the amount of elements in common ? For example: a=[1, 2, 3, 4, 5] b=[6, 7, 8, 9, 10, 1, 2, 11, 22] This should return 2, because there are only 2…
-
1
votes1
answer6005
viewsQ: Transform all elements of a list into floats
That’s the code I wrote. n_alunos=input('') x=0 idades=[] alturas=[] while x != n_alunos: x+=1 n=raw_input('') a=n.split(" ") idades.append(a[0]) alturas.append(a[1]) How to transform the elements…
-
1
votes2
answers204
viewsQ: Printar 2 interlaced strings
How do I print 2 interlaced strings (I don’t know if that’s what it’s called)? For example: string1='aovces' string2='m o' so that in the print "I love you guys" in the case, interspersing each…
-
2
votes3
answers1265
viewsQ: Ask for n python entries
I’m having a hard time with this exercise: "Do a program that asks n people your age, at the end the program should check if the average age of the class varies between 0 and 25, 26 and 60 and above…