Giter Club home page Giter Club logo

amrita143 / -organizational-hierarchy-of-a-company Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 155 KB

Java implementation of multi-child-organizational structure using AVL tree for O(logN) performance and created a web-interface of this hierarchical structure using HTML,CSS and JavaScript for visualization of the necessary functions.

Home Page: https://amrita143.github.io/-ORGANIZATIONAL-HIERARCHY-Of-a-Company/

Java 67.39% Makefile 1.36% HTML 2.37% JavaScript 28.88%
avl-tree-implementations heapsort html-css-javascript java javascript tree-structure

-organizational-hierarchy-of-a-company's Introduction

-ORGANIZATIONAL-HIERARCHY-Of-a-Company

Please read the "ass2.pdf" to understand the project in detail.

public interface OrgHierarchy {

public OrgHierarchy(); Initializes an empty organization

public boolean isEmpty(); Returns true if the organization is empty.

public int size(); Returns the number of employees in the organization

public int level(int id) ; Returns the level of the employee with ID=id

public void hireOwner(int id) ; Adds the first employee of the organization, which we call the owner. There is only one owner in an org who cannot be deleted

public void hireEmployee(int id, int bossid) ; Adds a new employee whose ID is id. This employee will work under an existing employee whose ID is bossid (note that this automatically decides the level of id, it is one more than that of bossid). Your code should throw an exception if the id already exists in the OrgHierarcy

public void fireEmployee(int id); Deletes an employee who does not manage any other employees.

public void fireEmployee(int id, int manageid); Deletes an employee (id) who might manage other employees. Manageid is another employee who works at the same level as id. All employees working under id will now work under manageid

public int boss(int id) ; Returns the immediate boss, the employee. Returns -1 if id is the owner’s ID

public int lowestCommonBoss(int id1, int id2) ; outputs the ID of the employee A who is a boss of both id1 and id2, and among all such persons has the largest level. In other words, we want to find the common boss who is lowest in the hierarchy in the company. If one of the input ids is the owner, output -1 .

}

-organizational-hierarchy-of-a-company's People

Contributors

amrita143 avatar

Stargazers

 avatar

Watchers

 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.