❔ Need help translating this psuedocode
Hello beginner here for my assignment of translating some psuedocode. i am not sure how to check if a list is empty in the while loop
4 Replies
I think it's supposed to merge two lists
Not two integers
So both
left
and right
should be lists of... somethingCouldn't you make it generic and contrain T to INumber<T> and make the two Lists be List<T>?
Perhaps something like this
Yes I agree. Then to check if a list is empty just do if(left.Count == 0)
Though it is kinda strange they decided to name the two input lists “left” and “right” and not something more descriptive, like listA and listB, imo
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.