Data Structures & Algorithms

Sorting Algorithms

Sort passenger records using different DAA algorithms and sorting options.

01
Problem

Arrange passenger records according to the selected field.

→
Algorithm

Manual DAA Sorting

→
Output

Sorted passenger records

↕

Passenger Sorting Control

Select a field, choose ascending or descending order, or use the priority queue. Quick Sort is the only sorting algorithm used on this page.

Records: 14Comparisons: 0Swaps/Moves: 0Execution: 0 msAlgorithm: Quick Sort

Quick Sort visualizer

Press Run Quick Sort to animate Lomuto partitioning. The last bar in each range is the pivot.

UnsortedPivotScanningPivot placed
Passenger records14 records
Priority Queue: Priority 1 is processed first, followed by 2, 3, 4 and 5. This is useful for senior citizens, children and special-assistance passengers.
⌕

Linear Search Visualizer

Search passenger records one by one. Enter a passenger name or ID, then optionally narrow the scan by boarding status.

Records scanned: 0Matches: 0Execution: 0 msAlgorithm: Linear Search

Passenger scan

Choose a status or enter a passenger name/ID, then run the search.

Not scannedCurrent recordMatch
Records scanned from left to right0 / 14
Search results will appear here.

Passenger Dataset

Sorted Passenger Records

IDNameFlightSeatGroupPriorityTypeStatus

How It Works

  1. Select a field such as Name, ID, Seat, Boarding Group, Flight or Priority.
  2. Select Ascending or Descending order.
  3. For boarding queues, choose Priority Queue.
  4. Manual Quick Sort sorts the passenger dataset using a pivot and partitioning.
  5. Comparisons, swaps/moves and execution time are measured at runtime.