Skip to content

kartikvyas1/queuePython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

queuePython

queue implementation in python using list

Your Assignment: Build a queue management class that has the following methods:

  1. add – gets a userId as a parameter. Returns the position it got in the queue.
  2. removeByUser – gets a userId as a parameter. Removes the user from the queue.
  3. removeByPosition – gets a position as a parameter (starting from 1). Removes the user at that position.
  4. move – gets a fromPosition and toPosition as parameters. Moves the user to the new position.
  5. swap – gets position1 and position2 as parameters. Swaps the users between the positions.
  6. reverse – reverses the order of the queue: whoever was last is now first.
  7. print – prints to stdout the queue in correct order in the following format {position}:{userId} Notes: • ● Please start with a basic working implementation and then extend. • ● At the end of 2 hours (or earlier), please email back your deliverables, including test output, based on the sample file. • ● If anything in the question is unclear, make assumptions, write them down as comments in the code and continue. • ● Please write everything from scratch, using only standard objects such as Scalars, Arrays, Hashes, Maps etc. Do not use any frameworks, built in language Queue classes or other reference code from the web.

About

queue implementation in python using list

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages