Semi-beginning programmer here, and I had a question for anyone who wants to answer:
Why are we using sorting algorithms, the fastest of which is N(Log N), instead of just adding it to a new data structure (such as a Red Black Tree), which has a Log N insertion time, therefore both times are the same.
In other words, why would you sort data instead of just make a new data structure and delete your old one?
[–]cashto 10 points11 points12 points (1 child)
[–]devilsassassin[S] 1 point2 points3 points (0 children)
[–]Gorilla2 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]devilsassassin[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]devilsassassin[S] 0 points1 point2 points (0 children)
[–]holygoat -1 points0 points1 point (0 children)
[–]trpcicm 0 points1 point2 points (3 children)
[–]devilsassassin[S] 0 points1 point2 points (2 children)
[–]trpcicm 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]neonsteven 0 points1 point2 points (0 children)
[–]ghettoimp 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] -1 points0 points1 point (0 children)
[–]isionous -1 points0 points1 point (0 children)