Skip to content

daheda/tripsorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Using Composer :

composer install

If you don't have composer, you can get it from Composer

Test the application

Using command line 1- Enter to the main folder. 2- run the command

./vendor/bin/phpunit

Explaination

Desing pattern Strategy is used to choose the algorithm, so we have 2 methods to solve the problem: -Complexity of Eulerian algorithm : not yet implemented -Complexity of SimpleSorter : O(n) = ((n-1)^2 -(n-1))/2 (polynomial)

Design pattern Factory is used to create the boarding card

return [
  'bus' => '\Daheda\TripSorter\Transport\BoardingCards\BusBoardingCard',
  'train' => '\Daheda\TripSorter\Transport\BoardingCards\TrainBoardingCard',
  'flight' => '\Daheda\TripSorter\Transport\BoardingCards\FlightBoardingCard',
];

About

Challange php.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages