I need a c++ program that is able to determine whether or not a given array is sorted in ascending or descending order. then after that the program should reverse the direction of order
Ahmed_217 0 Newbie Poster
Recommended Answers
Jump to PostDitto rproffitt, but have you considered there is a possible third state? What if the array is not sorted at all? What happens then? If you are guaranteed that it is sorted then you only have to check the first two elements, or the first and last to determine the …
All 3 Replies
rproffitt 2,701 https://5calls.org Moderator
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Ahmed_217 commented: well if its not sorted the output should say "array is not sorted" and if it is it should say that then reverse the direction +0
toneewa 115 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.