Tagged: stack


Sort the stack in ascending order

Problem : Sort the given stack into an ascending order without using recursion. Logic: Pop an item from the original stack and push it onto the sorted stack. If the poped item from the...

Tower of hanoi 0

Tower of hanoi

Problem : The Towers of Hanoi is a classic puzzle with 3 pegs and multiple disks of different sizes. The goal of the puzzle is to move all the disks from the first peg...

Implement a stack using javascript 0

Implement a stack using javascript

Problem description : Create a stack data structure in javascript. Stack organizes data into the sequential order. It similar to the stack of books in a library or stack of dishes in the kitchen...