Skip to content
11 changes: 10 additions & 1 deletion Data-Structures/Array/test/LocalMaximomPoint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('LocalMaximumPoint tests', () => {
})

it('test boundary maximum points - should find first maximom point from the top', () => {
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
const Array = [13, 2, 3, 4, 5, 6, 12]
expect(LocalMaximomPoint(Array)).toEqual(6)
})
Expand All @@ -26,4 +25,14 @@ describe('LocalMaximumPoint tests', () => {
const Array2 = [13, 16, 5, 41, 3, 2, 1]
expect(LocalMaximomPoint(Array2)).toEqual(3)
})

it('test with positive and negative numbers', () => {
const Array2 = [-4, -3, -2, -1, -5, 4, -1]
expect(LocalMaximomPoint(Array2)).toEqual(3)
})

it('test with floating-point numbers', () => {
const Array2 = [1.5, 3.5, 2.5, 0.5, -1.5, -3.5, -2.5]
expect(LocalMaximomPoint(Array2)).toEqual(1)
})
})
4 changes: 2 additions & 2 deletions Data-Structures/Queue/QueueUsing2Stacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Queue {
}

// display elements of the inputstack
listIn(output = (value) => console.log(value)) {
listInput(output = (value) => console.log(value)) {
let i = 0
while (i < this.inputStack.length) {
output(this.inputStack[i])
Expand All @@ -40,7 +40,7 @@ class Queue {
}

// display element of the outputstack
listOut(output = (value) => console.log(value)) {
listOutput(output = (value) => console.log(value)) {
let i = 0
while (i < this.outputStack.length) {
output(this.outputStack[i])
Expand Down