Suppose I have an array of dates
DateTime[] dt = new DateTime[10];
// populate array with dates
How can I find the maximum date without using LINQ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You mention using a sorting algorithm, presumably so that you can just ask for:
After the array was sorted. The thing is, you’d need to find a sorting algorithm that performs better than
O(n)to gain any advantage. Bubble Sort isO(n^2)so there’s no point in using it; it performs worse, on average, than just running through the list once.