Divide and Conquer Pseudocode for Largest and Smallest - 66991

Solution Posted by


Rating : (19)A+
Solution Detail
Price: $20.00
  • From: Computer Science,
  • Posted on: Sun 22 Jun, 2014
  • Request id: None
  • Purchased: 0 time(s)
  • Average Rating: No rating
Request Description

pseudocode divide and conquer largest and smallest

write a pseudocode for divide-and-conquer algorithm for finding the values of both the largest and smallest elements in an array of n numbers.

Solution Description

algorithm largestSmallest(numbers[1..n]) -> (smallest, largest)


if (n == 1)

return (A[1], A[1])

else if (n ==