store the words in linked list while taking the input... As they have not
mentioned constraints on data structure ..
and reverse the linked list...
Regards,
Sumedh
On 10/31/07, Somesh Jaiswal <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I was asked a question in an interview to Reverse the order of word
If the 'root' node has to be such that the height of the resultant
tree should be minimum, then this root node must lie in the middle of
the largest possible path between any 2 points in this graph.
Given above, start doing a DFS from any arbitrary node. This is doable
in O(n). It will return ret
Hi,
I was asked a question in an interview to Reverse the order of words in a
sentence.
eg. "Google is an awesome place to work" should be reversed as "work to
place awesome an is Google"
The solution should be efficient and shouldn't use any extra memory.
Pl suggest me some solution.
Regards,
On Oct 24, 3:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> In fact, we could use only 3 colors to do this, if this graph is
> connected.
>
> At first, I guess you know the famous 4-color theorem, so 4 colors is
> enough.
> In fact, if this graph can be disconnected, then we have to use 4
On Oct 29, 8:26 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Consider the following scenario.
>
> Let A be the vertex moved from Set 1 to Set 2. Which means that A
> had more edges within Set1 compared to those in Set 2. Now it is quite
> possible that there might be an edge B in Set