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!

11th Jun 2025, 3:31 PM
RAMさん
RAMさん - avatar
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?
11th Jun 2025, 6:10 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
0
Can you show your code?
11th Jun 2025, 5:55 PM
Brian O'Connell
Brian O'Connell - avatar
0
Mihaly Nyilas I can understand it a little better now. Thank you!
11th Jun 2025, 6:18 PM
RAMさん
RAMさん - avatar
0
Brian O'Connell Unfortunately I cannot, as it is a school assignment and posting it would get me in trouble.
11th Jun 2025, 6:19 PM
RAMさん
RAMさん - avatar
0
no, you didn't find the error. when I call the function, I have to pass 2 integers....
11th Jun 2025, 6:40 PM
Mihaly Nyilas
Mihaly Nyilas - avatar