Skip to content

[BUG] <title> fixing the wrong file name of the code(the code was something different than the file name) #4543

@piyush-gpt

Description

@piyush-gpt

Description

In the Stack folder, there is a program named "nextSmaller.java" but actually the code written inside it is of previous smaller element . To find the next smaller element, we need to find the first element smaller than the current element present at its right but the code actually was finding the previous smaller element as it is looking for smaller element on the left .
so that's why the name of the file is wrong and it should be "prevSmaller.java".

So I am correcting this bug
also I am pulling a request for adding a new code in the Stack folder for finding next smaller element of the current element in an array, that is the first element greater than the current element present at its right.

Steps to reproduce

  1. Go to src Folder
  2. Go to [main/java/com/thealgorithms]
  3. Go to Stacks Folder
  4. The title of file "NextSmallerElement.java" is wrong as the code inside it is for finding previous smaller element

Excepted behavior

correct name of the file should be "prevSmaller.java"

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions