Compare commits

..

3 Commits

Author SHA1 Message Date
abf78fb87f small fix in numbers 2025-12-10 15:00:50 +01:00
aa07932c6a add to .gitignore 2025-12-10 14:59:45 +01:00
85aedf3b8d add highscores.txt back to gitignore 2025-12-09 10:30:29 +01:00
6 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View File

@ -4,3 +4,6 @@ doble_initial.exe
runTests
stack.o
test_stack.o
highscores.txt
stack.o

View File

@ -5,6 +5,7 @@
#include <string.h>
#include <time.h>
//Vergleicht
int compareUnsignedInt(const void *a, const void *b) {
unsigned int x = *(unsigned int *)a;
unsigned int y = *(unsigned int *)b;
@ -64,7 +65,7 @@ unsigned int *createNumbers(unsigned int len) {
// Returns only the only number in numbers which is present twice. Returns zero
// on errors.
unsigned int getDuplicate(const unsigned int numbers[], unsigned int len) {
unsigned int getDuplicate(const unsigned int *numbers, unsigned int len) {
if (!numbers || len < 2)
return 0;

View File

@ -1,6 +1,8 @@
#ifndef NUMBERS_H
#define NUMBERS_H
int compareUnsignedInt(const void *a, const void *b);
// Returns len random numbers between 1 and 2x len in random order which are all different, except for two entries.
// Returns NULL on errors. Use your implementation of the binary search tree to check for possible duplicates while
// creating random numbers.

BIN
stack.o

Binary file not shown.

View File

@ -10,6 +10,7 @@
void test_createNumbers_length(void) {
unsigned int *arr = createNumbers(TEST_ARRAY_LEN);
TEST_ASSERT_NOT_NULL(arr);
free(arr);
}

Binary file not shown.