Coder Social home page Coder Social logo

Sirisha Nippani's Projects

cv icon cv

My personal profile

priorityqueueassignment icon priorityqueueassignment

Prog lang: Java In this problem, there are types of events: ENTER (a student enters the queue) or SERVED. A unique token is assigned to any student entering the queue. The queue serves the students based on the following criteria: The student having the highest Cumulative Grade Point Average (CGPA) is served first. Any students having the same CGPA will be served by name in ascending case-sensitive alphabetical order. Any students having the same CGPA and name will be served in ascending token order. Given a sequence of events, print the names of students who are yet to be served(based on above criteria). If the queue is empty, print EMPTY. Input Format The first line of input contains an integer, , denoting the total number of events. Each of the subsequent lines will be of the following two forms: ENTER name CGPA token - The student to be inserted into the priority queue. SERVED - The highest priority student in the queue was served. Constraints where where each token i is a unique integer. Output Format Print the names (based on the criteria) of the students who are not served at all after executing all events; if every student in the queue was served, then print EMPTY. Sample Input 12 ENTER John 3.75 50 ENTER Mark 3.8 24 ENTER Shafaet 3.7 35 SERVED SERVED ENTER Samiha 3.85 36 SERVED ENTER Ashley 3.9 42 ENTER Maria 3.6 46 ENTER Anik 3.95 49 ENTER Dan 3.95 50 SERVED Sample Output Dan Ashley Shafaet Maria

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.