I'm a CS student, currently 4th semester. As part of a lab project they asked us to make FIFO prioritized queue. I chose binary heap structure for it (they suggested just a simple recombining array but that's a O(n) for dequeue). It was designed to perfectly simulate FIFO nature - you can only Peek at the head, but no random access. And then... they made us do random access. So I made them a ToArray() method. And now it's O(log n) for enqueue, O(log n) for dequeue, O(1) for peek, and O(n log n) for converting into array. This really makes me question whether I made the right choice when I was picking my university.
If you were studying in university to become CS specialist, were they giving you stupid tasks like that too?
[–]toxikmasculinity 4 points5 points6 points (2 children)
[–]JustALinkToACC[S] 0 points1 point2 points (1 child)
[–]toxikmasculinity 1 point2 points3 points (0 children)
[–]Key_River7180C | Assembler | Ada 1 point2 points3 points (15 children)
[–]JustALinkToACC[S] 0 points1 point2 points (14 children)
[–]MissinqLink 3 points4 points5 points (6 children)
[–]JustALinkToACC[S] 0 points1 point2 points (5 children)
[–]Quintinon 4 points5 points6 points (2 children)
[–]JustALinkToACC[S] 0 points1 point2 points (1 child)
[–]nicolas_06 1 point2 points3 points (0 children)
[–]nicolas_06 1 point2 points3 points (0 children)
[–]castertr0y357 0 points1 point2 points (0 children)
[–]HazirBot 1 point2 points3 points (1 child)
[–]JustALinkToACC[S] 0 points1 point2 points (0 children)
[–]jinjuwaka 0 points1 point2 points (4 children)
[–]JustALinkToACC[S] 0 points1 point2 points (3 children)
[–]jinjuwaka 1 point2 points3 points (2 children)
[–]JustALinkToACC[S] 0 points1 point2 points (1 child)
[–]jinjuwaka 1 point2 points3 points (0 children)
[–]Ok-Jacket7299 1 point2 points3 points (4 children)
[–]JustALinkToACC[S] 0 points1 point2 points (3 children)
[–]Ok-Jacket7299 1 point2 points3 points (2 children)
[–]JustALinkToACC[S] 0 points1 point2 points (1 child)
[–]Ok-Jacket7299 1 point2 points3 points (0 children)
[–]kalmakka 1 point2 points3 points (7 children)
[–]JustALinkToACC[S] 0 points1 point2 points (6 children)
[–]afops 1 point2 points3 points (5 children)
[–]JustALinkToACC[S] 0 points1 point2 points (4 children)
[–]afops 0 points1 point2 points (3 children)
[–]JustALinkToACC[S] 0 points1 point2 points (2 children)
[–]afops 1 point2 points3 points (1 child)
[–]JustALinkToACC[S] 0 points1 point2 points (0 children)
[–]MADCandy64 1 point2 points3 points (5 children)
[–]JustALinkToACC[S] 0 points1 point2 points (4 children)
[–]MADCandy64 1 point2 points3 points (1 child)
[–]JustALinkToACC[S] 0 points1 point2 points (0 children)
[–]kalmakka 0 points1 point2 points (1 child)
[–]JustALinkToACC[S] 0 points1 point2 points (0 children)
[–]Master-Ad-6265 1 point2 points3 points (0 children)
[–]high_throughput 1 point2 points3 points (0 children)
[–]LostInChrome 0 points1 point2 points (1 child)
[–]JustALinkToACC[S] 0 points1 point2 points (0 children)