Added algorithm for linear data structures