Ok. so you have a list.
Iterating over it is linear isn't it?
Ahh... you will need a doubly linked list or an arraylist.does it solve ur
prob?
--
Rohit Saraf
Second Year Undergraduate,
Dept. of Computer Science and Engineering
IIT Bombay
http://w
@Rohit I accept that tokenization is linear. But how do you say
iteration over tokens in the new list and printing in reverse order as
linear?
On 6/5/10, Rohit Saraf wrote:
> Tokenization is done in linear time. Just save the words in an list (And
> what makes you think of non-linearity in tokeni
Tokenization is done in linear time. Just save the words in an list (And
what makes you think of non-linearity in tokenization!)
And then iteration over the tokens is trivially linear.
--
Rohit Saraf
Second Year Undergraduate,
Dept. of Computer Scienc
Rohit, you are very well awake
On Sat, Jun 5, 2010 at 9:49 AM, Rohit Saraf wrote:
> Have you posted the same question twice or i am feeling sleepy?
>
> --
> --
> Rohit Saraf
> Second Year Undergraduate,
> Dept. of Computer Science and Engineerin
@Shobhit
@Rohit
Is it done it linear time?? I dont think so...
On Sat, Jun 5, 2010 at 9:33 AM, Rohit Saraf wrote:
> Tokenize the string and print it reverse!
>
> --
> --
> Rohit Saraf
> Second Year Undergraduate,
> Dept. of Computer Science and Eng
Its simple...
Reverse the whole string than reverse each word. an dthe work is done
complexity O(n)
This is a standard question of interview
On Sat, Jun 5, 2010 at 9:49 AM, Rohit Saraf wrote:
> Have you posted the same question twice or i am feeling sleepy?
>
> --
> -
Have you posted the same question twice or i am feeling sleepy?
--
--
Rohit Saraf
Second Year Undergraduate,
Dept. of Computer Science and Engineering
IIT Bombay
http://www.cse.iitb.ac.in/~rohitfeb14
--
You received this message because you are su
Tokenize the string and print it reverse!
--
--
Rohit Saraf
Second Year Undergraduate,
Dept. of Computer Science and Engineering
IIT Bombay
http://www.cse.iitb.ac.in/~rohitfeb14
--
You received this message because you are subscribed to the Google
Reverse the string first and then reverse individual tokens.
So, first we can reverse the whole string as
"It is a fine morning" gets converted to "gninrom enif a si tI" and then
reverse each token in the string so that end result would be the desired
result.
On Fri, Jun 4, 2010 at 8:01 PM, Raj
If I've a string like It is a fine morning, the algorithm has to print
"morning fine a is It" and not "gninrom enif a si tI"
The algo has to do this in linear time. Can someone help me out in this
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" grou
If I've a string like It is a fine morning, the algorithm has to print
"morning fine a is It" and not "gninrom enif a si tI"
The algo has to do this in linear time. Can someone help me out in this
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" grou
11 matches
Mail list logo