• Stars
    star
    1
  • Language
    Java
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

I implemented an event counter using red-black tree. Each event has two fields: id and count, where count is the number of active events with the given id. The event counter stores only those id’s whose count is > 0. Once a count drops below 1, that ID is removed. My program initailly builds a red-black tree from a sorted list of n events(in ascending order of id) in O(n) time. My program takes a list of commands from standard input stream and gives the appropriate output. I ran the program on all the 4 test files and got the correct result each time.