This is a java swing based application that helps in visualizing how a particular data structure is growing/shrinking as data is being added/removed to it
When DS Selector opens up, it should have Stack radio button pre-selected. It appears that the behind the scene functionality is already implemented as if you hit Next without selecting anything, Stack visualization appears on the next frame. We need to explicitly make it selected for visual correctness.
List data structure code (in package ds) is currently incomplete. Provide implementation of the functions
void addRandomValues(); //adds 10 random integer values to the data structure
void add (Integer element);
Resizing the "DS Visualizer" frame does not resize the display area, which sort of beats the purpose of resizing at all! It will be a good idea to make the display area follow the size of the entire frame.
If the value to be deleted (on the top of the stack) is also present inside the stack, hitting the remove button deletes the other one. For example, in the figure below, the third 54 (circled) will be deleted if Remove button is clicked. Requires investigation and fix!
For stack visualization, all values (except the top value) are misaligned. We need to push the remaining values ahead by 'n' spaces to make it align with the top value.
Clicking remove on an empty queue throws a Java exception, though it is not effecting the GUI. The exception either needs to be caught/handled correctly or prevented from happening.
The images next to the selected data structure on the frame "DS Selector" are incorrect. Currently a queue image is displayed when stack is selected, heap image when queue is selected and stack image when binary heap is selected.
Clicking remove on an empty stack throws a Java exception, though it is not effecting the GUI. The exception either needs to be caught/handled correctly or prevented from happening.
The input fields expect an integer, however no checks are in place to ensure that. If the user enters a string the program throws an exception. Proper exception handling is required at the back end (formal or informal). And the user should be provided feedback if he/she enters invalid input.
The interface currently only lists methods, without any comments on their purpose and/or intended usage. Adding comments to each method would be helpful and increase code readability and quality.
Stack and Queue, when selected, have some pointers displayed in the display area even when the data structure is empty. This gives a nice visual representation of the empty data structure. Tree and Heap, however, have nothing displayed if the data structure is empty. It will be good to have a root pointer pointing to the top of the tree (and point to nothing if the data structure is empty) to have a more consistent visual representation.