DSA Easy Notes (C#)
DSA Easy Notes (C#) 🚀 DSA Easy Notes (C#) 1. Reverse String Input: "hello" Output: "olleh" Explanation: We reverse characters order. string str = "hello"; char[] arr = str.ToCharArray(); Array.Reverse(arr); Console.WriteLine(new string(arr)); Difference: Original: h e l l o Reversed: o l l e h 2. Palindrome Input: "madam" Output: Palindrome Explanation: Same forward & backward. string str = "madam"; string rev = new string(str.Reverse().ToArray()); Console.WriteLine(str == rev ? "Palindrome" : "Not"); Difference: Forward: madam Backward: madam → Same ✔ 3. Max in Array Input: [1,5,3,9,2] Output: 9 Explanation: Compare all values and keep largest. int[] arr = {1,5,3,9,2}; int max = arr[0]; foreach(int i in arr) { if(i > max) max = i; } Console.WriteLine(max); Difference: Compare: 1→5→9 → Max found = 9 4. Fibonacci Inpu...