Processing of Multiple Digital Inputs

please let me know what algorithm are you using to detect the output of sensors

There is no algorithm. The code reads the state of each input pin.

However, I should point out that the code I posted, whilst showing the principle of reading several inputs in quick succession is flawed. Instead of detecting that an input is HIGH it should actually detect that the input has become HIGH since the last time that it was read. This is not difficult to do but first you need to understand the principle of reading several inputs in quick succession.

I was a bit confused if there's any difference in pinchangeInterrupt and external interrupt

External interrupts are detected on specific pins of the Arduino. Pins 2 and 3 on a Uno, for instance.

Pin Change interrupts can be used on most digital pins but there is more work (programming) required to detect that a pin in a group of pins on a port has changed state and then to determine exactly which pin has changed state. Did you look at the example on the page linked to in reply #7 ?