0
Merge and MergeSort algorithms
Can someone explain to me how to implement a Merge algorithm in my C++ code (without giving me the actual code, of course). I understand it in theory, but I struggle immensely with actually writing it. My assignment expects me to translate it from pseudocode into C++, but since I'm a beginner, I'm really bad at it, and I don't have everything memorized on how to do certain things. It's a lot of information to take in, so please be patient with me. If someone could it explain it to me like I'm a toddler, that would be just fine lol. Thank you!
5 ответов
+ 1
this is not c++, nor python, nor.... just pseudo code
a <- INT:input
b <- INT:input
FUNCTION fn_name(INT: a, INT b)
IF a < b
OUT a
ELSE
OUT b
END_FUNCTION
fn_name()
similarly you can have WHILE / ENDWHILE
do you understand this code? can you code it?
0
Can you show your code?
0
Mihaly Nyilas I can understand it a little better now. Thank you!
0
Brian O'Connell Unfortunately I cannot, as it is a school assignment and posting it would get me in trouble.
0
no, you didn't find the error. when I call the function, I have to pass 2 integers....