r/learnjavascript • • May 14 '21

Remove Duplicate Value from array

Post image
234 Upvotes

89 comments sorted by

View all comments

Show parent comments

1

u/[deleted] May 15 '21 edited Aug 31 '25

[removed] — view removed comment

0

u/StoneCypher May 15 '21

wow you're really going to try to line by line?

The "n not in deduped" is a linear search of deduped.

this is the second n

 

and getting it down that far takes a fairly large amount of knowledge about the data. How did you think you were getting a presence test in linear time? That isn't possible

Please check out the Hash Map chapter of Introduction to Algorithms by CLRS.

Yeah, that just moves the cost from test to insert

Look, if you're going to talk down to people this way, don't ask for explanations from them

 

⁠Present the container

O(n)

😂 no, returning a pointer isn't o(n)

 

What details are you hiding in function?

You're trying to make commentary about container conversion costs by pretending that there's a conversion function?

i'm sorry, but this really isn't worth my time

0

u/[deleted] May 15 '21

[removed] — view removed comment

0

u/StoneCypher May 15 '21

This isn't worth my time.

You're ignoring clearly spelled out mistakes already given to you.

 

What should be worth your time is researching hash maps.

Nobody asked for your advice.

I realize you're trying to win, but there's no fight here. You asked me to explain myself, I did, you tried to argue, and I walked away.

Imagine telling someone returning a container was o(n), not admitting the mistake when it's pointed out, and continuing to try to give someone else a reading list 😂

"No but when you said converting containers, did you mean printing them on screen?"

🤣

Good day.

→ More replies (0)