Introduce data structures to work with

This commit is contained in:
2021-08-29 19:02:06 +02:00
parent b87cf37d0f
commit b11c1683c1
7 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,5 @@
package aud.exam.prep.array;
public class FullyUsedArray<T> {
public T[] theArray;
}

View File

@ -0,0 +1,6 @@
package aud.exam.prep.array;
public class PartiallyUsedArray<T> {
public T[] theArray;
public int numberOfUsedSlots;
}

View File

@ -0,0 +1,7 @@
package aud.exam.prep.list;
public class DoubleListItem<T> {
public T key;
public DoubleListItem<T> next;
public DoubleListItem<T> prev;
}

View File

@ -0,0 +1,6 @@
package aud.exam.prep.list;
public class SingleListItem<T> {
public T key;
public SingleListItem<T> next;
}

View File

@ -0,0 +1,7 @@
package aud.exam.prep.tree;
public class BinaryTreeNode<T> {
public T key;
public BinaryTreeNode<T> left;
public BinaryTreeNode<T> right;
}

View File

@ -0,0 +1,7 @@
package aud.exam.prep.tree;
public class MutliWayTreeNode<T> {
public T[] theKeys;
public MutliWayTreeNode<T>[] theSuccessors;
public int numberOfKeys;
}

View File

@ -0,0 +1,9 @@
package aud.exam.prep.tree;
public class TernaryTreeNode<T> {
public T key1;
public T key2;
public TernaryTreeNode<T> left;
public TernaryTreeNode<T> middle;
public TernaryTreeNode<T> right;
}