[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread Vladimir Reshetnikov
http://en.wikipedia.org/wiki/Lagrange_polynomial On Fri, Oct 30, 2009 at 7:32 AM, Shiqing Shen wrote: > > match the sequence exactly? > how to get that polynomial function, i am curious > > 2009/10/29, Vladimir Reshetnikov : > > Any finite sequence of numbers can be

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-29 Thread Vladimir Reshetnikov
Any finite sequence of numbers can be matched by polynomial function. On Thu, Oct 29, 2009 at 3:19 PM, Pawandeep wrote: > > hello everyone , > you are given a series of numbers like > > 2,4,6,8,10,12this is simple though > > nd u hve to identify that f(x) = x+ 2 for this series .. >

[algogeeks] Zig-zag subsequence

2009-04-09 Thread Vladimir Reshetnikov
Please help me to write the following algorithm: Call a sequence of integers a zig-zag sequence if the differences between successive numbers strictly alternate between positive and negative (for example, 5, 7,3,9,-1,4,3,6,0). The first difference may be either positive or negative. Given a sequenc