Giter Club home page Giter Club logo

airline-seating-algorithm's Introduction

Airline-Seating-Algorithm

A Ruby program to arrange the seating for the Airline Passengers

A program that helps to allocate seats to the passengers in a flight based on the following input and rules.

Rules for seating:

• Always seat passengers starting from the front row to back, starting from the left to the right • Fill aisle seats first followed by window seats followed by center seats (any order in center seats)

Input to the program will be:

• a 2D array that represents the rows and columns [[3,4], [4,5], [2,3], [3,4]]. This 2D array is just an example. The input to the program will be a dynamic 2D array. • Number of passengers waiting in queue.

See below for an example input and the respective seating arrangement based on the input.

A 2D array that represents the rows and columns [[3,2], [4,3], [2,3], [3,4]] (Please see the attached PDF document - 'Seating_2D_array.pdf')

If there were 30 passengers from then the seating output will be as in the attachment 'Seating_Result.pdf'

Below are the points to be noted:

  1. The Logic / Data structure / Algorithm used to successfully complete the programming challenge
  2. The elegance of the code, modularity and readability
  3. A VISUAL output that is printed (on the screen, in a console or exported to a file etc.) in way that is easy to read, identify the aisle, middle and window rows and has clear seating plan and passenger number.
  4. Testability, TDD and test cases

airline-seating-algorithm's People

Contributors

myselfrajeshco 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.