volisoft / Wasservolumen

Playing with Java EE 7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wasservolumen

Playing with Java EE 7

Simple EJB bean that calculates volume of water that fills gaps between bars. REST service accessible by

POST:  <context root>/myproject/water/volume

The application was tested using WildFly 9.0.1.Final

Request sample:

{
  "relief": [2,1,3]
}

Algorithm complexity:

  • Time complexity: best/worst/avg O(n) (makes two traversals in linear time)
  • Space complexity: best/worst/avg O(n) (requires additional array for storing maximum height of a wall from right hand side)

About

Playing with Java EE 7


Languages

Language:Java 100.0%