Problems in Algorithm Design Set I
Write pseudocode for all the problems posed. Assume that any
array that you are working with has integer values.
- How would you get the second highest number in an array of numbers
using just one pass through the array? You may not sort the array. The
second highest number is the highest number if you ignore one of the
- You are told that there is a common element in three sorted arrays
of integers. How do you find that element in the most efficient way?
- How do you find the largest partial sum in an array that has
both positive and negative numbers in just one pass through the array?
- Find the element that occurs the most number of times in a
sorted array in one pass through the array.
- Find all combinations of 3 elements in an array.