Compare commits
No commits in common. "abf78fb87f6c479e543342bec72e9a0f8a1fdf8c" and "1d7de0f5e3dceee386c6d0735de5f165ce1a421f" have entirely different histories.
abf78fb87f
...
1d7de0f5e3
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,6 +4,3 @@ doble_initial.exe
|
|||||||
runTests
|
runTests
|
||||||
stack.o
|
stack.o
|
||||||
test_stack.o
|
test_stack.o
|
||||||
highscores.txt
|
|
||||||
|
|
||||||
stack.o
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
//Vergleicht
|
|
||||||
int compareUnsignedInt(const void *a, const void *b) {
|
int compareUnsignedInt(const void *a, const void *b) {
|
||||||
unsigned int x = *(unsigned int *)a;
|
unsigned int x = *(unsigned int *)a;
|
||||||
unsigned int y = *(unsigned int *)b;
|
unsigned int y = *(unsigned int *)b;
|
||||||
@ -65,7 +64,7 @@ unsigned int *createNumbers(unsigned int len) {
|
|||||||
|
|
||||||
// Returns only the only number in numbers which is present twice. Returns zero
|
// Returns only the only number in numbers which is present twice. Returns zero
|
||||||
// on errors.
|
// 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)
|
if (!numbers || len < 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#ifndef NUMBERS_H
|
#ifndef NUMBERS_H
|
||||||
#define 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 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
|
// Returns NULL on errors. Use your implementation of the binary search tree to check for possible duplicates while
|
||||||
// creating random numbers.
|
// creating random numbers.
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
void test_createNumbers_length(void) {
|
void test_createNumbers_length(void) {
|
||||||
unsigned int *arr = createNumbers(TEST_ARRAY_LEN);
|
unsigned int *arr = createNumbers(TEST_ARRAY_LEN);
|
||||||
TEST_ASSERT_NOT_NULL(arr);
|
TEST_ASSERT_NOT_NULL(arr);
|
||||||
|
|
||||||
free(arr);
|
free(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
test_stack.o
Normal file
BIN
test_stack.o
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user