feat: insertion sort with binary search (#1182)

This commit is contained in:
syedjafer_k
2022-10-16 14:17:18 +05:30
committed by GitHub
parent 8c847e3aea
commit 18baef8e7e
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import { binaryInsertionSort } from '../BinaryInsertionSort'
describe('BinaryInsertionSort', () => {
it('should sort arrays correctly', () => {
expect(binaryInsertionSort([5, 4, 3, 2, 1])).toEqual([1, 2, 3, 4, 5])
expect(binaryInsertionSort([7, 9, 4, 3, 5])).toEqual([3, 4, 5, 7, 9])
})
})