instead of creating a bst why dontwe create a heap.then sort the heap .then
remove the duplictes from string...but will also chnge th order of
string.
On Sun, Sep 19, 2010 at 4:20 PM, Umer Farooq wrote:
> creating a bst would require extra space. You can do this with an array of
> char dude.
Yes ur correct...it will require some extra spacebst can be represented
in the array form ritelet me think in tht logic.
On 9/19/10, Umer Farooq wrote:
>
> creating a bst would require extra space. You can do this with an array of
> char dude.
>
> On Sun, Sep 19, 2010 at 3:31 PM, LG JAYA
creating a bst would require extra space. You can do this with an array of
char dude.
On Sun, Sep 19, 2010 at 3:31 PM, LG JAYARAM . wrote:
> hi buddy ...Im clear with the ideahereby I share the concept...
>
> wat exactly need to be done to solve this task isbetter create a Binary
> searc
hi buddy ...Im clear with the ideahereby I share the concept...
wat exactly need to be done to solve this task isbetter create a Binary
search tree...the Binary search tree will not allow duplicates and If u
perform a inorder traversalu can get the result...the task is
oversimple a
the interviewer would be stupid to ask this question!!!
Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652
On Sat, Sep 18, 2010 at 11:12 PM, jagadish wrote:
> You are given a string which is sorted.. Write a recursive function to
> remove the dupl
btw, if u rn't suppose to use any extra space, then u should be going for
iterative solution; since recursion uses extra space by default.
On Sat, Sep 18, 2010 at 11:33 PM, Umer Farooq wrote:
> here's the java implementation
>
> package removeduplicates;
> import java.io.*;
> /**
> *
> * @auth
here's the java implementation
package removeduplicates;
import java.io.*;
/**
*
* @author UmerFarooq
*/
public class Main {
/**
* @param args the command line arguments
*/
public static char[] input;
public static void remDep(int i, int j)
{
if (j<0)
You are given a string which is sorted.. Write a recursive function to
remove the duplicate characters in the string.
eg: potatoeos
output: potaes
NO extraspace like hash/ bitmaps..
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to t