Posts by Ryo Akiyama • 3 points
4 posts
-
0
votes1
answer88
viewsQ: How to compare 2 lists and return another list with equal elements? - Haskell
My code is this comparar :: [Int] -> [Int] -> [Int] comparar [] [] = [] comparar (a:as) (b:bs) = [x | x <- as, x == b] ++ [x | x <- bs, x == a] What’s wrong with the code above?…
-
0
votes0
answers78
viewsQ: How to make quicksort "manual"
I’ve already made one Selectionsort manual in Pyhon see below: lista = [] # digite 0 para encerrar a entrada de dados while True: x = input('Entrada: ') if x == '0': break else: lista.append(x) nota…
-
0
votes1
answer3668
viewsQ: How do I use fgets instead of gets?
before "talking" about my problem, first look at my code and ignore the accent errors in the console if you are going to run. #include <stdio.h> #include <stdlib.h> #include…
-
0
votes2
answers112
viewsQ: What’s wrong with my Quicksort code in C?
Here is my code: #include <stdio.h> #include <stdlib.h> int lista[1000]; int tamanho; main () { printf("Tamanho: "); scanf("%d", & tamanho); int c; for (c = 0; c < tamanho; c++) {…