String Reversal
Geeksforgeeks' solution checks for str==null (which I presume is in case someone calls reverse()).
My questions are as follows:
1. How many different ways can the actual terminating condition be called? I used (str == "") but it seems (str.Length <= 1) or (str.Length==0) can also be used. What are some others? What are the advantages/disadvantages of each?
2. Why doesn't Console.Write(str) where str is null call up an unhandled exception?
2 Replies