Enter value for index 1: 10 Enter value for index 2: 20 Enter value for index 3: 30 Enter value for index 4: 40 Enter value for index 5: 50 Enter value for index 6: 60 Enter value for index 7: 70 Inserting: 10 Index 1 is in location 1 Inserting: 20 Index 2 is in location 2 Inserting: 30 Index 3 is in location 3 Inserting: 40 Index 4 is in location 4 Inserting: 50 Index 5 is in location 5 Inserting: 60 Index 6 is in location 6 Inserting: 70 Index 7 is in location 7 Pick an index: 1 Enter a new value: 80 Moving 1 with value -80 down past 2 with value -20 Moving 1 with value -80 down past 4 with value -40 Index 1 is in location 4 Pick an index: 7 Enter a new value: 5 Moving 7 with value -5 up past its parent, 3 with value -30 Moving 7 with value -5 up past its parent, 2 with value -20 Index 7 is in location 1 Now all items will be removed Moving 3 with value -30 down past 2 with value -20 Index 3 is in location 3 The next index is 7 with weight 5 Moving 6 with value -60 down past 3 with value -30 Index 6 is in location 3 The next index is 2 with weight 20 Moving 5 with value -50 down past 4 with value -40 Index 5 is in location 2 The next index is 3 with weight 30 Moving 1 with value -80 down past 5 with value -50 Index 1 is in location 2 The next index is 4 with weight 40 Index 6 is in location 1 The next index is 5 with weight 50 Index 1 is in location 1 The next index is 6 with weight 60 Index 1 is in location 1 The next index is 1 with weight 80