Code Monkey home page Code Monkey logo

ds-stack-queue-operations's Introduction

DS - Stack Queue Operations

This project solves the certain problems of Data Structures using Stacks and Queues.

Question 1: Transfer elements from stack S1 to stack S2 so that the elements from stack S2 are in the same order as on stack S1 • Using one additional stack (Use either array or link list to implement stack and for input only take integers)

Question 2: Put the elements on the stack S in ascending order using one additional stack and some additional variables. (Use either array or link list to implement stack and for input only take integers)

Question 3: Define a stack in terms of a queue. That is, create a class Class StackQ { Queue Q; . . . . . . . . . . Void push (int e1) { Q.enqueue(e1); . . . . . . . . . . (Use either array or link list to implement stack and for input only take integers)

Question 4: Define a queue in terms of a stack. (Use either array or link list to implement stack and for input only take integers)

Question 5: Reverse the order of elements on stack S1 a) Using two additional stacks b) Using one additional queue c) Using one additional stack and some additional variables (Make a Reverse( ) function in stack class)

Question 6: Write a program that determines whether or not an input string is a palindrome, that is, whether or not it can be read the same way forward and backward. Use stack implementation. (Consider using multiple stacks.)

Example: MADAM, it is a palindrome.

Question 7: Given a string, write a program (Use stack implementation) to check whether the pairs and the orders of “{“ , ”}” , ”(“ , ”)” , ”[" , “]” are balanced.

Example= “[ ( ) ] { } { [( )( )] ( ) }”
Above expression have balance brackets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.