How do you reverse the words in a string?
"My name is Yet Another Software Junk"
to
"Junk Software Another Yet is name My"
answer:
1. first reverse the string
"My name is Yet Another Software Junk" to
"knuJ erawtfoS rehtonA teY si eman yM"
2. reverse word by word now
"knuJ erawtfoS rehtonA teY si eman yM" to
"Junk Software Another Yet is name My"
You are given a circular single linked list of sufficiently many number of
nodes(say more than 1 crore). You need to delete a node say P and you are
given a pointer to P in the circular single list.
Suggest the most efficient methodology of deleting the node P from the
circular single linked list without rounding about the circular single
linked list.
Answer:
We have a list looking like: ... -> Node(i-1) -> Node(i) -> Node(i+1) -> ... and we need to delete Node(i).
July 2005 August 2005 October 2005 December 2005 March 2006 June 2006 July 2006 December 2006 February 2007 June 2007 March 2010 May 2010
Subscribe to Posts [Atom]