GithubHelp home page GithubHelp logo

azamzow / ispalindrome Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 185 KB

This project has a Queue Implementation (in three ways), a Stack Implementation (in three ways), and a isPalindrome (using Stack and Queue).

Java 100.00%

ispalindrome's Introduction

Queue/Stack Implementation in Palindrome Project

Description

This project has a Queue Implementation (in three ways), a Stack Implementation (in three ways), and a isPalindrome (using Stack and Queue). The three ways that they are implemented is array-based, list-based, and reference-based.

  1. TestQueue.java utilizes the three Queue implementations in the classes QueueArrayBased.java, QueueReferenceBased.java, and QueueListBased.java. Each of these classes implement queueInterface class.

Below is a UML Diagram of the TestQueue.java,

UML Diagram

  1. isPalindrome.java is an application where both Stack and Queue are utilized to check whether the given word is in a symmetric language (i.e., palindrome)
  • By definition, palindrome = {str | str reads the same left to right as right to left}

This program executes the classes QueueArraybased.java and StackArrayBased.java.

To Run

Using terminal on Mac:

$ cd isPalindrome
$ javac TestQueue.java
$ java TestQueue
--------------Then-----------
$ javac isPalindrome.java
$ java isPalindrome

Output

When the above programs are ran, they should look like this..

TestQueue

-Runs QueueArrayBased first, then QueueReferenceBased, followed by QueueListBased.

The final result will print out...

5 6 7 8 9

a5 a6 a7 a8 a9

5.0 6.0 7.0 8.0 9.0

isPalindrome

-It asks the user to enter a string to check if it is a palindrome. An Example output is shown below..

Enter a string to check if it is a palindrome:
test
Input string is not a palindrome.
Enter a string to check if it is a palindrome:
alula
Input string is a palindrome.

ispalindrome's People

Contributors

azamzow avatar

Watchers

James Cloos avatar

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.