Final Homework: Data Structures

SICI 4036 - Data Structures

IDE

Requirements:


Diagram

The image contains a Java class diagram illustrating IntLinkedStack, IntLinkedQueue and IntBinarySearchTree, along with their corresponding interfaces: IntStack, IntQueue and IntBST.

Write a Java program using the Interface provided to create the class of Stack, Queue, and Binary Search Tree (BST) using a linked list for integer numbers.


Solution

The IntLinkedQueue uses nodes to store integers in a linked list, following the FIFO (First-In-First-Out) principle for enqueue and dequeue operations. The IntLinkedStack employs nodes in a linked list, to the LIFO (Last-In-First-Out) principle for push and pop operations. The IntBinarySearchTree organizes nodes in a hierarchical structure, ensuring efficient insertion, deletion, and search operations using the binary search property. The app LinkedDataStructure is a Java application that shows how linked data structures are used.

  1. Queue Implementation: IntLinkedQueue.java, IntQueue.java
  2. Stack Implementation: IntLinkedStack.java, IntStack.java
  3. BST Implementation: IntBST.java, IntBinarySearchTree.java
  4. Application: LinkedDataStructureApp.java
  5. Exception Handling: EmptyCollectionException.java