From 6bb22a25e7976db1b1f22acf92ce64162fb4a45c Mon Sep 17 00:00:00 2001 From: "Andrei Jiroh Halili (STI College Meycauayan)" Date: Tue, 25 Aug 2026 09:49:32 +0800 Subject: [PATCH] quick stash Signed-off-by: Andrei Jiroh Halili (STI College Meycauayan) --- .zed/settings.json | 3 ++ .../studentops/projects/oopLabs/main.java | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .zed/settings.json create mode 100644 java/src/dev/andreijiroh/studentops/projects/oopLabs/main.java diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..52f6db4 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,3 @@ +{ + "tab_size": 2 +} diff --git a/java/src/dev/andreijiroh/studentops/projects/oopLabs/main.java b/java/src/dev/andreijiroh/studentops/projects/oopLabs/main.java new file mode 100644 index 0000000..c959207 --- /dev/null +++ b/java/src/dev/andreijiroh/studentops/projects/oopLabs/main.java @@ -0,0 +1,42 @@ +package dev.andreijiroh.studentops.projects.oopLabs; + +/** + * 02 Performance Task 1 - Data Structures and Algorithms + * @author Andrei Jiroh Halili (STI College Meycauayan) + */ + class Node { + String data; + Node next; + + public Node(String data) { + this.data = data; + this.next = null; + } + } + + public class main { + public static void main(String[] args) { + // Init 3 entries first + Node track = new Node("Song A"); + track.next = new Node("Song B"); + track.next.next = new Node("Song C"); + Node initialHead = track; + System.out.println("Initial state:"); + while (initialHead != null) { + System.out.print(initialHead.data + " -> "); + initialHead = initialHead.next; + } + System.out.print("null"); + System.out.println(); + + // add Song D to the tracks queue + track.next.next.next = new Node("Song D"); + Node addedNewNode = track; + System.out.println("After adding Song D:"); + while (addedNewNode != null) { + System.out.print(addedNewNode.data + " -> "); + addedNewNode = addedNewNode.next; + } + System.out.print("null"); + } + } -- 2.51.2