A list of puns related to "Fibonacci Heap"
EDIT: If anybody stumbles on this problem again in the future, the answer is: when computing amortized runtimes using the potential method, the potential method can hide constants as well.
Hello /r/askcomputerscience ,
I've been having a problem understanding this amortized analysis of Fibonacci Heap amortized runtimes. Something about the justifications given for delete min/popmin being O(log n) seems like nonsense to me. Here's my breakdown of the problem:
A fibonacci heap is a list of trees that satisfy the heap property, along with a reference to the item . On each tree, certain nodes may be marked "losers".
There are a few important operations on the fibonacci heap:
Inserts the item and updates the minimum when the inserted node is smaller than the current minimum.
This is like an "extract min" of any minheap. Fibonacci popmin has a few particularities:
After popping the min from the linked list, it dumps the min's children onto the linked list. Then, it combines all nodes into the largest possible trees. This is achieved by keeping an array of roots along with a linear scan over the roots, where trees are funneled to an array index at their size, then merged if there is already a tree of that size at that index. All "loser" nodes become unmarked. Finally, the minimum is updated.
The decrease key operation decreases a key and then checks for a heap violation. If a heap violation is found, the key is dumped to the root list. Then one of two things can occur:
Okay, so here's the problem setup:
What is the amortized analysis of the Popmin operation?
As far as I can tell, this is how the video breaks it down:
First, he defines phi, the potential function of the fibonacci heap, to be the number of root nodes plus the number of loser nodes. When computing amortized cost, we simply compute the sum: actual worst-case cost + change in phi.
Then while analyzing popmin, he analyzes the runtime of putting the children of the min on the root node, which is o(log n). This follows from some other analysis elsewhere.
Then, he analyzes the runtime of the cleanup (combining all nodes into trees) portion. He
... keep reading on reddit β‘Recently I learned that when Dijkstra Algorithm is implemented with a fibonacci heap, the time complexity tremendously reduces to O(E+Vlog(V)), where E is the edges and V is the Vertices of the graph.
I donβt know much about Fibonacci heap either, all I know is that itβs quite difficult to implement one in practise. And there is no point implementing one for the shortest path algorithm unless your graph is quite large.
Any comments on how to go on achieve that? This is open to all kind of discussion. Thank you.
I am the OP of this link, (https://cs.stackexchange.com/questions/102851/d-ary-heap-implementation-vs-fibonacci-heap-implementation-dijkstra-performance) please help still not much progress.
Let's say that Dijkstraβs algorithm with the priority queue using a d-ary heap. if adjusting d, we can try to achieve the best runtimes for the algorithm with d being ~ |E|/|V|.
Then for a fixed |V|, what is the largest possible ratio between this runtime and the runtime of Dijkstra using a Fibonacci heap? Where knowing the Fibonacci heap: delete_min = O(log |V |), insert/decrease_key = O(1) (amortized) and |V | Γ delete_min + (|V | + |E|) Γ insert = O(|V|log|V|+|E|).
On the other hand, d-ary heap implementation : delete_min = O($\dfrac{d \log|V|}{log d}$) , insert/ decrease_key =O($\dfrac{log|V|}{log d}$) , and |V | Γ delete_min + (|V | + |E|) Γ insert = O( (|V|Β·d+|E|)$\dfrac{ \log|V|}{log d}$ ).
As trying to follow a provide solution, but I am not sure why it reduces to O($\dfrac{log|V|}{log |E|/|V|})$, in the case 1 where |E| dominates, so Dijkstra with Fibonacci heap is O(|E|), How can we get the ration as O($\dfrac{log|V|}{log |E|/|V|})$ while Dijkstra with d-ary heap is O $( (|V|Β·d+|E|)\dfrac{ \log|V|}{log d}$)?
https://preview.redd.it/ul736dfe3ia21.png?width=1828&format=png&auto=webp&s=b27fb490c7c145b0d293caa039e15762ccc1fb77
I already asked this in /r/AskMath:
https://www.reddit.com/r/AskProgramming/comments/79ingi/the_fibonacci_heap_essentially_relies_on_the/
And /r/AskProgramming:
https://www.reddit.com/r/askmath/comments/79iq4f/the_fibonacci_heap_essentially_relies_on_the/
Unfortunately this so far only yielded responses pointing out well known properties of the plastic number without any ideas on the actual question(on which I currently also don't have any ideas, hence the question... :)) so I decided to post it here, too.
For reference, Fibonacci heaps:
https://en.wikipedia.org/wiki/Fibonacci_heap
And here, a good introduction to the plastic number:
http://bib.irb.hr/datoteka/628836.Plastic_Number_-_Construct.pdf
See also my comment here for some more well known properties of the plastic number, posted in response to the above mentioned pointing out of well known properties:
https://www.reddit.com/r/askmath/comments/79iq4f/the_fibonacci_heap_essentially_relies_on_the/dp38f14/?depth=4
(And, off topic, since I don't think this has any application to the heap topic, but I figured I'd mention it since I find it interesting, if anyone has any interest in the "morphic numbers" property mentioned in the paper I linked above, someone derived "morphic angles" from that:
https://link.springer.com/article/10.1007/s00004-015-0285-1)
I've written a C++ implementation of a Fibonacci heap and queue: https://github.com/beniz/fiboheap
Fibonacci heaps are especially useful in search and random search algorithms, from Dijkstra to A* and AO* as priority queues with mutable keys.
Boost includes an implementation, but I must confess I rather do not like my programs to depend on Boost for a few hundred lines of code. Maybe this will be of use to others.
But most importantly, C++ and STL gurus here may want to give me advice on how to improve it / make it more compliant to STL-like container.
Original post:
https://www.reddit.com/r/csMajors/comments/pe541i/rejected_for_full_time_return_offer_after/
When I made the post here 3 months ago and it took off, I got a lot of good advice to start applying to companies immediately. I probably applied to aprox. 200 companies for new grad in the month of September.
Here are some notable rejections:
Failed after OA:
IBM 9/16
Stripe 9/16
Ocient 9/16
Expedia 9/26
Better 9/26
Google 9/26
Redfin 10/7
Failed after phone:
Facebook 10/11
Bloomberg: 10/25
Oracle
Failed after final:
Amazon 11/26
Qualtrics 11/15
Offers:
JPMorgan 130k NYC (switch to another location) Accepted
Dell 86k Austin
GM 100k Detroit
Chevron 100k Houston
Progressive 75k Remote
Caterpillar 90k Chicago
Ford 90k Detroit
Wells Fargo 74k Raleigh
First thing to note is that Microsoft (or probably any FAANG) on resume got me responses from just about every company. There were countless ghosts and rejections not shown here but I got a good shot at almost all big tech companies (except Apple which always ghosts me).
If you notice, I only got offers from companies that have fully behavioral interview loops. Yes Chevron and JPMorgan asked technical questions but they were LC super easy (Fibonacci question for example). The good news about this is my STAR responses really work. The bad news is I could not meet the bar in my LeetCode style technical interviews.
I started the recruiting season after my Microsoft rejection with 81 LeetCode solved. About 60 Easy, 21 Medium. From September to now I completed 46 problems for a current total of 127 (63 E / 57 M / 7 H).
Clearly this amount wasnβt enough. I bombed basically every DS&A interview round except the one for JPMC where they asked me to count the occurrences of nums in an arrayβ¦
My strategy for the last 3 months was to fully complete and internalize this even more consolidated version of the B75 list written by the original B75 creator. It is 50 questions instead of 75:
https://techinterviewhandbook.org/best-practice-questions/
This list opened my eyes to Tries, Heaps, and a bunch of other crucial LeetCode patterns I had not known.
At my current level of preparation, I feel that I have seen each LC pattern at least once and know about each data structure. However, I donβt feel like Iβve ma
... keep reading on reddit β‘Do your worst!
Hello Reddit,
I have throughout my bachelor realised that I would much rather study data science than my "free" business masters. I have been looking at data science masters at other universities here in Denmark, where I can see that all of them require me to take a lot of courses, where one of them being Algorithms and Data Structures. I have found that course on a university, where I can pay 1/10th of the price if I would just go to the exam rather than taking the course.
I am then wondering if I can teach myself the curriculum by using paid material online or youtube content.
The curriculum looks like this (using google translate):
Knowledge
Sorting algorithms. Graphing algorithms for determining shortest paths and least spanning trees. Fibonacci heaps and binary search trees. Amortized analysis. Divide and rule. Dynamic programming. Greedy algorithms. Proofs of correctness.
Skills Recognize algorithmic paradigms (eg divide and rule, dynamic programming, greedy algorithms) and apply them to new issues. Perform asymptotic complexity analysis of algorithms (including solving recursive equations). Apply appropriate data structures to new issues. Argue for the correctness of algorithms using induction (including the formulation of loop variants) as well as direct and contradictory evidence.
Best regards
It really does, I swear!
For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.
I said "hey look, an escaPEA"
No one near me but it didn't half make me laugh for a good hour or so!
Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies π
Theyβre on standbi
Buenosdillas
Pilot on me!!
Dad jokes are supposed to be jokes you can tell a kid and they will understand it and find it funny.
This sub is mostly just NSFW puns now.
If it needs a NSFW tag it's not a dad joke. There should just be a NSFW puns subreddit for that.
Edit* I'm not replying any longer and turning off notifications but to all those that say "no one cares", there sure are a lot of you arguing about it. Maybe I'm wrong but you people don't need to be rude about it. If you really don't care, don't comment.
When I got home, they were still there.
What did 0 say to 8 ?
" Nice Belt "
So What did 3 say to 8 ?
" Hey, you two stop making out "
I won't be doing that today!
You take away their little brooms
This morning, my 4 year old daughter.
Daughter: I'm hungry
Me: nerves building, smile widening
Me: Hi hungry, I'm dad.
She had no idea what was going on but I finally did it.
Thank you all for listening.
There hasn't been a post all year!
Why
Itβs pronounced βNoel.β
After all his first name is No-vac
I am the OP of this link, (https://cs.stackexchange.com/questions/102851/d-ary-heap-implementation-vs-fibonacci-heap-implementation-dijkstra-performance) please help still not much progress.
Let's say that Dijkstraβs algorithm with the priority queue using a d-ary heap. if adjusting d, we can try to achieve the best runtimes for the algorithm with d being ~ |E|/|V|.
Then for a fixed |V|, what is the largest possible ratio between this runtime and the runtime of Dijkstra using a Fibonacci heap? Where knowing the Fibonacci heap: delete_min = O(log |V |), insert/decrease_key = O(1) (amortized) and |V | Γ delete_min + (|V | + |E|) Γ insert = O(|V|log|V|+|E|).
On the other hand, d-ary heap implementation : delete_min = O($\dfrac{d \log|V|}{log d}$) , insert/ decrease_key =O($\dfrac{log|V|}{log d}$) , and |V | Γ delete_min + (|V | + |E|) Γ insert = O( (|V|Β·d+|E|)$\dfrac{ \log|V|}{log d}$ ).
As trying to follow a provide solution, but I am not sure why it reduces to O($\dfrac{log|V|}{log |E|/|V|})$, in the case 1 where |E| dominates, so Dijkstra with Fibonacci heap is O(|E|), How can we get the ration as O($\dfrac{log|V|}{log |E|/|V|})$ while Dijkstra with d-ary heap is O $( (|V|Β·d+|E|)\dfrac{ \log|V|}{log d}$)?
Processing img 2lmyxyl32ia21...
I already asked this, over in /r/AskProgramming; but I figured I'd ask it here, too.
For reference, the Fibonacci heap: https://en.wikipedia.org/wiki/Fibonacci_heap
And here, a good introduction to the plastic number: http://bib.irb.hr/datoteka/628836.Plastic_Number_-_Construct.pdf
For reference, the Fibonacci heap: https://en.wikipedia.org/wiki/Fibonacci_heap
And here, a good introduction to the plastic number: http://bib.irb.hr/datoteka/628836.Plastic_Number_-_Construct.pdf
Edit:
Also crossposted to /r/AskMath, unfortunately no ideas yet, but I linked to some more details about the number sequences to which the plastic number relates there, something only very incompletely covered in most of the literature:
https://www.reddit.com/r/askmath/comments/79iq4f/the_fibonacci_heap_essentially_relies_on_the/
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.