René's URL Explorer Experiment
Title: R50-T003: Cross-check getParentPosition (KeyPriorityQueue.js) [Data-Structures/Heap/KeyPriorityQueue.js] by stavansomaiya · Pull Request #101 · S-AI-Projects/TheAlgorithms-JavaScript · GitHub
Open Graph Title: R50-T003: Cross-check getParentPosition (KeyPriorityQueue.js) [Data-Structures/Heap/KeyPriorityQueue.js] by stavansomaiya · Pull Request #101 · S-AI-Projects/TheAlgorithms-JavaScript
X Title: R50-T003: Cross-check getParentPosition (KeyPriorityQueue.js) [Data-Structures/Heap/KeyPriorityQueue.js] by stavansomaiya · Pull Request #101 · S-AI-Projects/TheAlgorithms-JavaScript
Description: Description
Task
R50-T003 · task 3 of 10 · Independent reference comparison
Issue
#3 · Cross-check getParentPosition
Student
Stavan Somaiya · URN e26b07f1064
File → function
Data-Structures/Heap/KeyPriorityQueue.js → getParentPosition (line 22 at the pinned commit, line 36 after this PR)
Pinned source
TheAlgorithms/JavaScript @ 5c39e87 · KeyPriorityQueue.js#L22
Branch
stavansomaiya:student/e26b07f1064/R50-T003 → S-AI-Projects:master (one commit on 5c39e87)
Outcome
No mismatch on any of the 89 compared positions. The implementation is unchanged.
Summary
Compares getParentPosition in Data-Structures/Heap/KeyPriorityQueue.js with two independent oracles that never call it. One is a hand-reviewed explicit table for positions 0..24. The other is a different method: the 1-based bit-shift rule ((p + 1) >> 1) - 1, checked for positions 0..63. The PR also locks down the FIFO fixture (A, B, C, D) and the empty-state behaviour.
Files changed
File
Lines
What changed
Data-Structures/Heap/KeyPriorityQueue.js
+15 / −1
JSDoc with one representative result; getParentPosition exported (no logic change)
Data-Structures/Heap/test/KeyPriorityQueue.test.js
+92 / −1
25 explicit-table tests, bit-shift oracle, representative result, FIFO fixture, instance isolation
work/R50-T003/ (9 files)
evidence
check.py runner, README.md write-up, evidence.mjs, results.json and logs; coursework only, kept out of any upstream PR
Related Issue
Fixes: #3
This PR covers only R50-T003. Each of the 10 tasks has its own branch, commit and PR; see All 10 tasks under Additional Notes.
Type of Change
Bug Fix
New Feature
UI/UX Improvement
Performance Improvement
Tests
Documentation
Refactoring / Maintenance
CI/CD
Changes Made
Data-Structures/Heap/test/KeyPriorityQueue.test.js: 25 explicit-table tests, the bit-shift oracle comparison, and a representative result (getParentPosition(4) === 1). The fixture is push A, B, C; pop twice; push D; drain. After every operation it checks the explicit removed key and size, and that a plain-array FIFO reference agrees. Also tests that separate instances do not share contents (checked both ways).
Data-Structures/Heap/KeyPriorityQueue.js: JSDoc explaining one representative result (getParentPosition(4) === 1, because node 1 has children 3 and 4) and the -1 root sentinel. getParentPosition is now also exported. No logic change.
work/R50-T003/: check.py, evidence.mjs (one row per position and per fixture step) and results.
Screenshots / Recordings
There is no UI, so the recording is the terminal output of a fresh run on 23 Nov 2026. The run used a clean checkout of this branch with a new npm ci from the lockfile. The output is copied verbatim; only the temporary checkout path is replaced by a label.
Focused tests: npx vitest run … --reporter=verbose, 38/38 passed
$ npx vitest run Data-Structures/Heap/test/KeyPriorityQueue.test.js --reporter=verbose
RUN v1.2.1
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Method isEmpty > Check heap is empty
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Method isEmpty > Check heap is not empty
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Methods push and pop > Test Case 1
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Methods push and pop > Test Case 2
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Methods push and pop > Test Case 3
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Method contains > Check heap does not contain element
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Method contains > Check heap contains element
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Method update > Update without change in position
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > Key Priority Queue > Method update > Update with change in position
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 0 is -1
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 1 is 0
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 2 is 0
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 3 is 1
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 4 is 1
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 5 is 2
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 6 is 2
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 7 is 3
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 8 is 3
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 9 is 4
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 10 is 4
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 11 is 5
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 12 is 5
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 13 is 6
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 14 is 6
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 15 is 7
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 16 is 7
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 17 is 8
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 18 is 8
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 19 is 9
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 20 is 9
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 21 is 10
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 22 is 10
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 23 is 11
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > explicit table: parent of position 24 is 11
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > bit-shift oracle agrees for positions 0..63
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > getParentPosition against independent references > representative result: getParentPosition(4) is 1
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > queue order relying on getParentPosition > enqueue A, B, C; remove twice; insert D; drain -> A, B, C, D
✓ Data-Structures/Heap/test/KeyPriorityQueue.test.js > queue order relying on getParentPosition > separate instances do not share contents
Test Files 1 passed (1)
Tests 38 passed (38)
Automated check: python3 work/R50-T003/check.py, exit 0
$ python3 work/R50-T003/check.py
[PASS] getParentPosition(0) vs explicit table
input: 0
expected: -1
actual: -1
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(1) vs explicit table
input: 1
expected: 0
actual: 0
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(2) vs explicit table
input: 2
expected: 0
actual: 0
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(3) vs explicit table
input: 3
expected: 1
actual: 1
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(4) vs explicit table
input: 4
expected: 1
actual: 1
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(5) vs explicit table
input: 5
expected: 2
actual: 2
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(6) vs explicit table
input: 6
expected: 2
actual: 2
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(7) vs explicit table
input: 7
expected: 3
actual: 3
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(8) vs explicit table
input: 8
expected: 3
actual: 3
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(9) vs explicit table
input: 9
expected: 4
actual: 4
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(10) vs explicit table
input: 10
expected: 4
actual: 4
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(11) vs explicit table
input: 11
expected: 5
actual: 5
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(12) vs explicit table
input: 12
expected: 5
actual: 5
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(13) vs explicit table
input: 13
expected: 6
actual: 6
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(14) vs explicit table
input: 14
expected: 6
actual: 6
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(15) vs explicit table
input: 15
expected: 7
actual: 7
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(16) vs explicit table
input: 16
expected: 7
actual: 7
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(17) vs explicit table
input: 17
expected: 8
actual: 8
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(18) vs explicit table
input: 18
expected: 8
actual: 8
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(19) vs explicit table
input: 19
expected: 9
actual: 9
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(20) vs explicit table
input: 20
expected: 9
actual: 9
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(21) vs explicit table
input: 21
expected: 10
actual: 10
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(22) vs explicit table
input: 22
expected: 10
actual: 10
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(23) vs explicit table
input: 23
expected: 11
actual: 11
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(24) vs explicit table
input: 24
expected: 11
actual: 11
source: KeyPriorityQueue.js:15-16 children 2p+1, 2p+2; parent floor((p-1)/2)
[PASS] getParentPosition(0..63) vs bit-shift oracle
input: "0..63"
expected: [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31]
actual: [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31]
source: KeyPriorityQueue.js:36 getParentPosition
[PASS] fixture step 1: push A(1)
input: ["push", "A", 1]
expected: {"removed": null, "size": 1, "referenceRemoved": null, "referenceSize": 1}
actual: {"removed": null, "size": 1, "referenceRemoved": null, "referenceSize": 1}
source: KeyPriorityQueue.js:59-63 push adds and shifts up
[PASS] fixture step 2: push B(2)
input: ["push", "B", 2]
expected: {"removed": null, "size": 2, "referenceRemoved": null, "referenceSize": 2}
actual: {"removed": null, "size": 2, "referenceRemoved": null, "referenceSize": 2}
source: KeyPriorityQueue.js:59-63 push adds and shifts up
[PASS] fixture step 3: push C(3)
input: ["push", "C", 3]
expected: {"removed": null, "size": 3, "referenceRemoved": null, "referenceSize": 3}
actual: {"removed": null, "size": 3, "referenceRemoved": null, "referenceSize": 3}
source: KeyPriorityQueue.js:59-63 push adds and shifts up
[PASS] fixture step 4: pop
input: ["pop"]
expected: {"removed": "A", "size": 2, "referenceRemoved": "A", "referenceSize": 2}
actual: {"removed": "A", "size": 2, "referenceRemoved": "A", "referenceSize": 2}
source: KeyPriorityQueue.js:69-75 pop removes the least priority
[PASS] fixture step 5: pop
input: ["pop"]
expected: {"removed": "B", "size": 1, "referenceRemoved": "B", "referenceSize": 1}
actual: {"removed": "B", "size": 1, "referenceRemoved": "B", "referenceSize": 1}
source: KeyPriorityQueue.js:69-75 pop removes the least priority
[PASS] fixture step 6: push D(4)
input: ["push", "D", 4]
expected: {"removed": null, "size": 2, "referenceRemoved": null, "referenceSize": 2}
actual: {"removed": null, "size": 2, "referenceRemoved": null, "referenceSize": 2}
source: KeyPriorityQueue.js:59-63 push adds and shifts up
[PASS] fixture step 7: pop
input: ["pop"]
expected: {"removed": "C", "size": 1, "referenceRemoved": "C", "referenceSize": 1}
actual: {"removed": "C", "size": 1, "referenceRemoved": "C", "referenceSize": 1}
source: KeyPriorityQueue.js:69-75 pop removes the least priority
[PASS] fixture step 8: pop
input: ["pop"]
expected: {"removed": "D", "size": 0, "referenceRemoved": "D", "referenceSize": 0}
actual: {"removed": "D", "size": 0, "referenceRemoved": "D", "referenceSize": 0}
source: KeyPriorityQueue.js:69-75 pop removes the least priority
[PASS] empty state after drain
input: "isEmpty()"
expected: true
actual: true
source: KeyPriorityQueue.js:50-51 isEmpty
[PASS] separate instances do not share contents
input: "a.push('A', 1); b untouched"
expected: {"aEmpty": false, "bEmpty": true}
actual: {"aEmpty": false, "bEmpty": true}
source: KeyPriorityQueue.js:41-44 constructor creates a new heap and Map
[KILLED] mutant parent formula off by one (floor(p / 2)): 'const getParentPosition = (position) => Math.floor((position - 1) / 2)' -> 'const getParentPosition = (position) => Math.floor(position / 2)'
failed: Key Priority Queue Methods push and pop Test Case 1
failed: Key Priority Queue Methods push and pop Test Case 2
failed: Key Priority Queue Methods push and pop Test Case 3
failed: Key Priority Queue Method update Update with change in position
failed: getParentPosition against independent references explicit table: parent of position 0 is -1
failed: getParentPosition against independent references explicit table: parent of position 2 is 0
failed: getParentPosition against independent references explicit table: parent of position 4 is 1
failed: getParentPosition against independent references explicit table: parent of position 6 is 2
failed: getParentPosition against independent references explicit table: parent of position 8 is 3
failed: getParentPosition against independent references explicit table: parent of position 10 is 4
failed: getParentPosition against independent references explicit table: parent of position 12 is 5
failed: getParentPosition against independent references explicit table: parent of position 14 is 6
failed: getParentPosition against independent references explicit table: parent of position 16 is 7
failed: getParentPosition against independent references explicit table: parent of position 18 is 8
failed: getParentPosition against independent references explicit table: parent of position 20 is 9
failed: getParentPosition against independent references explicit table: parent of position 22 is 10
failed: getParentPosition against independent references explicit table: parent of position 24 is 11
failed: getParentPosition against independent references bit-shift oracle agrees for positions 0..63
failed: getParentPosition against independent references representative result: getParentPosition(4) is 1
focused tests: 38/38 passed (node_modules/.bin/vitest run Data-Structures/Heap/test/KeyPriorityQueue.test.js --reporter=json --outputFile=work/R50-T003/vitest-focused.raw.json)
npm test: 11999/11999 passed (npm test -- --reporter=json --outputFile=work/R50-T003/vitest-full.raw.json)
R50-T003: all checks passed
(exit 0)
Testing
Automated check: python3 work/R50-T003/check.py installs from the lockfile and runs the focused tests. It then prints input / expected / actual for every fixture row, runs each deliberate mutant in a temporary copy, and finally runs the repository test script in non-watch mode. It exits non-zero if any assertion or step fails, and records every command in commands.log.
To reproduce:
git fetch https://github.com/stavansomaiya/TheAlgorithms-JavaScript.git student/e26b07f1064/R50-T003
git checkout FETCH_HEAD
python3 work/R50-T003/check.py
Recorded results (committed in results.json; tool versions in versions.txt):
Check
Command
Result
Install from lockfile
npm ci --ignore-scripts --no-audit --no-fund
✅ exit 0
Focused tests
vitest run Data-Structures/Heap/test/KeyPriorityQueue.test.js
✅ 38/38 passed
Fixture evidence (input / expected / actual / source line)
node work/R50-T003/evidence.mjs
✅ 36/36 rows match
Mutant (temporary copy): parent formula off by one (floor(p / 2))
applied by check.py
✅ caught by explicit table: parent of position 0 is -1
Repository test script, non-watch
npm test (vitest run)
✅ 11999/11999 passed
Code style
npm run check-style (Prettier)
✅ passes
Spelling (CI settings)
codespell
✅ no new findings
Acceptance criteria → evidence:
#
Done when (quoted from #3)
Evidence in this PR
1
The checked behavior is tied to getParentPosition in Data-Structures/Heap/KeyPriorityQueue.js; every assertion has an explicit expected value.
✅ explicit table: parent of position N is M (25 tests, N = 0..24) each assert a literal M. representative result asserts getParentPosition(4) is 1. The queue test asserts literal keys 'A'..'D' and a literal size after every step.
2
Enqueue A, B and C; remove twice; insert D; drain the queue. The removal order must be A, B, C, D. Exercise the documented empty-state behavior.
✅ enqueue A, B, C; remove twice; insert D; drain -> A, B, C, D checks the removed key and the size after every operation, against both a literal and a plain-array FIFO reference. Final order: ['A', 'B', 'C', 'D']. The documented empty state (isEmpty() === true, size 0) is checked before the first push and after draining.
3
Existing supported behavior and the public interface are preserved unless a failing regression demonstrates and documents a defect.
✅ No logic change (JSDoc and an extra export only). All 9 existing tests pass, and the full suite passes (11999/11999). separate instances do not share contents checks isolation in both directions.
4
The oracle uses a different method or a reviewed explicit result table; it does not call the function under test.
✅ Oracle 1 is a hand-reviewed table for positions 0..24, written from "children of p are 2p + 1 and 2p + 2". Oracle 2 uses a different method, the 1-based bit-shift rule ((p + 1) >> 1) - 1, for positions 0..63. Neither calls getParentPosition.
5
A mismatch is reduced to a minimal reproducible case and documented before any fix.
✅ No mismatch on any of the 89 positions, so no fix was needed. The reduction is still demonstrated: for the mutant Math.floor(position / 2) the minimal reproducible case is getParentPosition(0) (expected -1, mutant 0), documented in the README.
Evidence files: check.py · README.md (contract, fixture, baseline, findings) · evidence.mjs · results.json · vitest-focused.json
Checklist
I have tested my changes locally.
I have added or updated tests, if needed.
I have updated documentation, if needed.
I have followed the project's coding guidelines.
I have run the relevant tests and checks.
I have addressed previous review feedback, if applicable. (No review feedback yet.)
Additional Notes
No mismatch on any of the 89 compared positions. Sensitivity check: Math.floor(position / 2) in a temporary copy is caught; the minimal reproducible case is getParentPosition(0) (expected -1, mutant 0), reported by the named test explicit table: parent of position 0 is -1. Out of scope and only recorded: pop() on an empty queue leaves a stray "-1" property on _heap.
Scope: the PR changes only Data-Structures/Heap/KeyPriorityQueue.js, its test file and work/R50-T003/. work/R50-T003/ is coursework evidence and would be removed from any later upstream PR.
All 10 tasks (one PR each)
Task
Issue
Branch
Pull request
R50-T001: Lock down the contract of setBit
#1
R50-T001
#99
R50-T002: Define the supported boundaries of checkKeywordValidity
#2
R50-T002
#100
R50-T003: Cross-check getParentPosition
#3
R50-T003
#101 (this PR)
R50-T004: Test an invariant of swap
#4
R50-T004
#102
R50-T005: Make verification repeatable for newGeneration
#5
R50-T005
#103
R50-T006: Simplify one responsibility in countLetters
#6
R50-T006
#104
R50-T007: Publish a runnable example for DisjointSetTreeNode
#7
R50-T007
#105
R50-T008: Cover the failure behavior of TrieNode
#8
R50-T008
#106
R50-T009: Measure the work done by fibonacci
#9
R50-T009
#107
R50-T010: Strengthen the tests of OpenKnightTour
#10
R50-T010
#108
Open Graph Description: Description
Task
R50-T003 · task 3 of 10 · Independent reference comparison
Issue
#3 · Cross-check getParentPosition
Student
Stavan Somaiya · URN e26b07f1064
File → function
Data-Str...
X Description: Description
Task
R50-T003 · task 3 of 10 · Independent reference comparison
Issue
#3 · Cross-check getParentPosition
Student
Stavan Somaiya · URN e26b07f1064
File → function
Data-Str...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101
X: @github
direct link
Domain: github.com
IPv4 address: 140.82.114.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f95b3573-0a2a-2b23-0eef-554ab8531b5d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A69A:DEC36:195DEF8:23444A9:6B06DAD3 |
| html-safe-nonce | bbe84e27cb7366c5bd68ad7f85fbb4ef6a59043bbe5e9f923c4e93cf55d6cfec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjlBOkRFQzM2OjE5NURFRjg6MjM0NDRBOTo2QjA2REFEMyIsInZpc2l0b3JfaWQiOiI2MjA3OTY3MzI2NTI5NTc1NjM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 09e806d8b8994bfeaff799595daf66d449bd4dd958ff94d99e09707ba207cc8b |
| hovercard-subject-tag | pull_request:5450912425 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| twitter:image | https://avatars.githubusercontent.com/u/175632707?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/175632707?s=400&v=4 |
| og:image:alt | Description
Task
R50-T003 · task 3 of 10 · Independent reference comparison
Issue
#3 · Cross-check getParentPosition
Student
Stavan Somaiya · URN e26b07f1064
File → function
Data-Str... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06cadd0061c549662a50be90eb5baba7608f00f521574931eec01db0deb9e636 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/S-AI-Projects/TheAlgorithms-JavaScript git https://github.com/S-AI-Projects/TheAlgorithms-JavaScript.git |
| octolytics-dimension-user_id | 351892385 |
| octolytics-dimension-user_login | S-AI-Projects |
| octolytics-dimension-repository_id | 1444142713 |
| octolytics-dimension-repository_nwo | S-AI-Projects/TheAlgorithms-JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 97086543 |
| octolytics-dimension-repository_parent_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6953c712585a8d7406b7695e48fffcb670fd241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FS-AI-Projects%2FTheAlgorithms-JavaScript%2Fpull%2F101%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FS-AI-Projects%2FTheAlgorithms-JavaScript%2Fpull%2F101%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=S-AI-Projects%2FTheAlgorithms-JavaScript |
| Reload | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| Reload | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| Reload | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| S-AI-Projects | https://github.com/S-AI-Projects |
| TheAlgorithms-JavaScript | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript |
| Code | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript |
| Issues50 (50) | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/issues |
| Pull requests50 (50) | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pulls |
| Actions | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/actions |
| Projects | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/projects |
| Security and quality | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/security |
| Insights | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2FS-AI-Projects%2FTheAlgorithms-JavaScript%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2FS-AI-Projects%2FTheAlgorithms-JavaScript%2Fissues%2Fnew%2Fchoose |
| stavansomaiya | https://github.com/stavansomaiya |
| S-AI-Projects:master | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/tree/master |
| stavansomaiya:student/e26b07f1064/R50-T003 | https://github.com/stavansomaiya/TheAlgorithms-JavaScript/tree/student/e26b07f1064/R50-T003 |
|
Conversation
0
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101 |
|
Commits
1
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/commits |
|
Checks
0
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/checks |
|
Files changed
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| Please reload this page | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
|
R50-T003: Cross-check getParentPosition (KeyPriorityQueue.js) [Data-Structures/Heap/KeyPriorityQueue.js]
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#top |
|
Show all changes
1 commit
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
|
4110798
test(KeyPriorityQueue): cross-check getParentPosition against indepen…
stavansomaiya Nov 23, 2026
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/commits/41107981fb6a7a243264c9babae6ef0cfda7c4e9 |
|
Clear filters
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| Please reload this page | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
| Please reload this page | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
|
KeyPriorityQueue.js
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-3fac06c2ac1ba99cf3418747cf5510cad150eaf10ba46617af55bd609b839878 |
|
KeyPriorityQueue.test.js
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-1ab1ee7928cd1e5ca71a9938865eef30694fc7a523aceb13b7be05831fccc2bb |
|
README.md
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-db533395a9d8589e6b360d260634f02b558f15f97f82057e4bb598a650276d84 |
|
baseline.txt
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-d124b0c9beeceaf7e1446808eb155ea1c79f9f70f93e3b154bc8a8c927b65641 |
|
check.py
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-b601a0d5f97aa283b3eda2b203726137e3fde2fa8c1ff7cf8423c526c3fa5894 |
|
commands.log
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-c6d786ca6baa2cc0ef6f617f0ddad645aefedeb51d8abf4ceb9c5d759ac69b47 |
|
evidence.mjs
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-9359f5310609bec6aeafb22143655031ffbc73e0bccd3856c1b3ed8fe6b803da |
|
results.json
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-e1fe93a95f5ae6507282266ef1816a0dc81d036a911f1fb8efd00663414e945e |
|
task.json
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-a029071652145fe861f6a84d497d262733fc8ab10862744f3b189e784e795bb3 |
|
versions.txt
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-627f409b28c8cbf1d97de8a5152bbff7ea363dc7381130c1b960dab57f05725d |
|
vitest-focused.json
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-0b2779ab12812e197ffb791c4629e59282614ee7a55b6c71bb59c00333abae8c |
| Data-Structures/Heap/KeyPriorityQueue.js | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-3fac06c2ac1ba99cf3418747cf5510cad150eaf10ba46617af55bd609b839878 |
|
View file
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/blob/41107981fb6a7a243264c9babae6ef0cfda7c4e9/Data-Structures/Heap/KeyPriorityQueue.js |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/{{ revealButtonHref }} |
|
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-3fac06c2ac1ba99cf3418747cf5510cad150eaf10ba46617af55bd609b839878 |
|
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-3fac06c2ac1ba99cf3418747cf5510cad150eaf10ba46617af55bd609b839878 |
|
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-3fac06c2ac1ba99cf3418747cf5510cad150eaf10ba46617af55bd609b839878 |
| Data-Structures/Heap/test/KeyPriorityQueue.test.js | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-1ab1ee7928cd1e5ca71a9938865eef30694fc7a523aceb13b7be05831fccc2bb |
|
View file
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/blob/41107981fb6a7a243264c9babae6ef0cfda7c4e9/Data-Structures/Heap/test/KeyPriorityQueue.test.js |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/{{ revealButtonHref }} |
|
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-1ab1ee7928cd1e5ca71a9938865eef30694fc7a523aceb13b7be05831fccc2bb |
|
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-1ab1ee7928cd1e5ca71a9938865eef30694fc7a523aceb13b7be05831fccc2bb |
| work/R50-T003/README.md | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-db533395a9d8589e6b360d260634f02b558f15f97f82057e4bb598a650276d84 |
|
View file
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/blob/41107981fb6a7a243264c9babae6ef0cfda7c4e9/work/R50-T003/README.md |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/{{ revealButtonHref }} |
| work/R50-T003/baseline.txt | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files#diff-d124b0c9beeceaf7e1446808eb155ea1c79f9f70f93e3b154bc8a8c927b65641 |
|
View file
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/blob/41107981fb6a7a243264c9babae6ef0cfda7c4e9/work/R50-T003/baseline.txt |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/{{ revealButtonHref }} |
| Please reload this page | https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/101/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Response headers:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width
URLs of crawlers that visited me.