Started learning dsa and came across priority queues but I am stuck at lambda expressions in priority queue in java.
Map<Integer, Integer> map = new HashMap<>();
PriorityQueue<Integer> q = new PriorityQueue<>((a,b)->map.get(b)-map.get(a));
In the above expressions, how will this heap be a max heap, how a,b values are to be considered whats their source? I have understood that the lambda expressions return -ve or +ve values and on that basis, it's decided whether its going to be a max or min heap but what are a,b how are they evaluated, from where they are received.
Are a,b the values from heap? If they are, which values are they, the top ones or the bottom ones considering a max heap?