From b11c1683c16da6f7e51646918556ccd9efda6d4f Mon Sep 17 00:00:00 2001 From: Oshgnacknak Date: Sun, 29 Aug 2021 19:02:06 +0200 Subject: [PATCH] Introduce data structures to work with --- src/aud/exam/prep/array/FullyUsedArray.java | 5 +++++ src/aud/exam/prep/array/PartiallyUsedArray.java | 6 ++++++ src/aud/exam/prep/list/DoubleListItem.java | 7 +++++++ src/aud/exam/prep/list/SingleListItem.java | 6 ++++++ src/aud/exam/prep/tree/BinaryTreeNode.java | 7 +++++++ src/aud/exam/prep/tree/MutliWayTreeNode.java | 7 +++++++ src/aud/exam/prep/tree/TernaryTreeNode.java | 9 +++++++++ 7 files changed, 47 insertions(+) create mode 100644 src/aud/exam/prep/array/FullyUsedArray.java create mode 100644 src/aud/exam/prep/array/PartiallyUsedArray.java create mode 100644 src/aud/exam/prep/list/DoubleListItem.java create mode 100644 src/aud/exam/prep/list/SingleListItem.java create mode 100644 src/aud/exam/prep/tree/BinaryTreeNode.java create mode 100644 src/aud/exam/prep/tree/MutliWayTreeNode.java create mode 100644 src/aud/exam/prep/tree/TernaryTreeNode.java diff --git a/src/aud/exam/prep/array/FullyUsedArray.java b/src/aud/exam/prep/array/FullyUsedArray.java new file mode 100644 index 0000000..181de33 --- /dev/null +++ b/src/aud/exam/prep/array/FullyUsedArray.java @@ -0,0 +1,5 @@ +package aud.exam.prep.array; + +public class FullyUsedArray { + public T[] theArray; +} \ No newline at end of file diff --git a/src/aud/exam/prep/array/PartiallyUsedArray.java b/src/aud/exam/prep/array/PartiallyUsedArray.java new file mode 100644 index 0000000..f98b2c8 --- /dev/null +++ b/src/aud/exam/prep/array/PartiallyUsedArray.java @@ -0,0 +1,6 @@ +package aud.exam.prep.array; + +public class PartiallyUsedArray { + public T[] theArray; + public int numberOfUsedSlots; +} \ No newline at end of file diff --git a/src/aud/exam/prep/list/DoubleListItem.java b/src/aud/exam/prep/list/DoubleListItem.java new file mode 100644 index 0000000..31ae3b7 --- /dev/null +++ b/src/aud/exam/prep/list/DoubleListItem.java @@ -0,0 +1,7 @@ +package aud.exam.prep.list; + +public class DoubleListItem { + public T key; + public DoubleListItem next; + public DoubleListItem prev; +} \ No newline at end of file diff --git a/src/aud/exam/prep/list/SingleListItem.java b/src/aud/exam/prep/list/SingleListItem.java new file mode 100644 index 0000000..9e8e028 --- /dev/null +++ b/src/aud/exam/prep/list/SingleListItem.java @@ -0,0 +1,6 @@ +package aud.exam.prep.list; + +public class SingleListItem { + public T key; + public SingleListItem next; +} \ No newline at end of file diff --git a/src/aud/exam/prep/tree/BinaryTreeNode.java b/src/aud/exam/prep/tree/BinaryTreeNode.java new file mode 100644 index 0000000..6951fc7 --- /dev/null +++ b/src/aud/exam/prep/tree/BinaryTreeNode.java @@ -0,0 +1,7 @@ +package aud.exam.prep.tree; + +public class BinaryTreeNode { + public T key; + public BinaryTreeNode left; + public BinaryTreeNode right; +} diff --git a/src/aud/exam/prep/tree/MutliWayTreeNode.java b/src/aud/exam/prep/tree/MutliWayTreeNode.java new file mode 100644 index 0000000..4eebf14 --- /dev/null +++ b/src/aud/exam/prep/tree/MutliWayTreeNode.java @@ -0,0 +1,7 @@ +package aud.exam.prep.tree; + +public class MutliWayTreeNode { + public T[] theKeys; + public MutliWayTreeNode[] theSuccessors; + public int numberOfKeys; +} diff --git a/src/aud/exam/prep/tree/TernaryTreeNode.java b/src/aud/exam/prep/tree/TernaryTreeNode.java new file mode 100644 index 0000000..ed69f85 --- /dev/null +++ b/src/aud/exam/prep/tree/TernaryTreeNode.java @@ -0,0 +1,9 @@ +package aud.exam.prep.tree; + +public class TernaryTreeNode { + public T key1; + public T key2; + public TernaryTreeNode left; + public TernaryTreeNode middle; + public TernaryTreeNode right; +}