diff --git a/algorithms/CSharp/README.md b/algorithms/CSharp/README.md index edee912a..9a9c43ed 100644 --- a/algorithms/CSharp/README.md +++ b/algorithms/CSharp/README.md @@ -30,6 +30,7 @@ To run the `.cs` file, kindly use [.Net Finddle](https://dotnetfiddle.net/) - [Palindrome](src/Strings/palindrome.cs) - [Trie](src/Strings/trie.cs) - [Character Limit](src/Strings/character-limit.cs) +- [Reverse Words in String](src/Strings/reverse-words-in-string.cs) ## Search diff --git a/algorithms/CSharp/src/Strings/reverse-words-in-string.cs b/algorithms/CSharp/src/Strings/reverse-words-in-string.cs index 2372ce30..8f8a5314 100644 --- a/algorithms/CSharp/src/Strings/reverse-words-in-string.cs +++ b/algorithms/CSharp/src/Strings/reverse-words-in-string.cs @@ -1,8 +1,6 @@ using System; -//Reverse the order of the words in a given string -//Example: "Hello World" becomes "World Hello" - +//Time Complexity: O(n) namespace Algorithms.Strings { public class ReverseWordsInString @@ -15,6 +13,8 @@ namespace Algorithms.Strings Console.WriteLine(ReverseWords(originalString)); } + //Reverse the order of the words in a given string + //Example: "Hello World" becomes "World Hello" public static string ReverseWords(string input) { string[] words = input.Split(' ');