Aggiunto il supporto a Maven
This commit is contained in:
10
.classpath
10
.classpath
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
200
.gitignore
vendored
Normal file
200
.gitignore
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/java,intellij,eclipse,maven
|
||||
# Edit at https://www.gitignore.io/?templates=java,intellij,eclipse,maven
|
||||
|
||||
### Eclipse ###
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated
|
||||
|
||||
.sts4-cache/
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
.idea/modules.xml
|
||||
.idea/*.iml
|
||||
.idea/modules
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
### Intellij Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
# *.iml
|
||||
modules.xml
|
||||
.idea/misc.xml
|
||||
# *.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
.idea/**/sonarlint/
|
||||
|
||||
# SonarQube Plugin
|
||||
.idea/**/sonarIssues.xml
|
||||
|
||||
# Markdown Navigator plugin
|
||||
.idea/**/markdown-navigator.xml
|
||||
.idea/**/markdown-navigator/
|
||||
|
||||
### Java ###
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
.flattened-pom.xml
|
||||
|
||||
# End of https://www.gitignore.io/api/java,intellij,eclipse,maven
|
||||
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
AlgoritmiStruttureDati
|
||||
16
.idea/compiler.xml
generated
Normal file
16
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="AlgoritmiStruttureDati" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="AlgoritmiStruttureDati" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
||||
20
.idea/jarRepositories.xml
generated
Normal file
20
.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
17
.project
17
.project
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>AlgoritmiStruttureDati</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,12 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
16
pom.xml
Normal file
16
pom.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.fscotto</groupId>
|
||||
<artifactId>algoritmi-strutture-dati</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
public interface AdaptablePriorityQueue<K extends Comparable<K>, V> extends PriorityQueue<K, V> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/** Un albero binario */
|
||||
public interface BinaryTree<E> extends Tree<E> {
|
||||
@@ -1,10 +1,10 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
public interface CircularQueue<E> extends Queue<E> {
|
||||
|
||||
/**
|
||||
* Sposta alla fine della coda il suo elemento iniziale.
|
||||
* Se la coda è vuota non fa niente.
|
||||
* Se la coda <EFBFBD> vuota non fa niente.
|
||||
*/
|
||||
void rotate();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/**
|
||||
* Interfaccia che definisce una coda doppia: un contenitore di elementi con
|
||||
@@ -9,13 +9,13 @@ public interface Deque<E> {
|
||||
/** Restituisce il numero di elementi presenti nella coda doppia. */
|
||||
int size();
|
||||
|
||||
/** Verifica se la coda doppia è vuota. */
|
||||
/** Verifica se la coda doppia <EFBFBD> vuota. */
|
||||
boolean isEmpty();
|
||||
|
||||
/** Restituisce il primo elemento, senza toglierlo (null se la coda è vuota). */
|
||||
/** Restituisce il primo elemento, senza toglierlo (null se la coda <EFBFBD> vuota). */
|
||||
E first();
|
||||
|
||||
/** Restituisce l'ultimo elemento, senza toglierlo (null se la coda è vuota). */
|
||||
/** Restituisce l'ultimo elemento, senza toglierlo (null se la coda <EFBFBD> vuota). */
|
||||
E last();
|
||||
|
||||
/** Inserisce un elemento all'inizio della coda doppia. */
|
||||
@@ -24,10 +24,10 @@ public interface Deque<E> {
|
||||
/** Inserisce un elemento alla fine della coda doppia. */
|
||||
void addLast(E e);
|
||||
|
||||
/** Elimina e restituisce il primo elemento della coda (null se è vuota). */
|
||||
/** Elimina e restituisce il primo elemento della coda (null se <EFBFBD> vuota). */
|
||||
E removeFirst();
|
||||
|
||||
/** Elimina e restituisce l'ultimo elemento della coda (null se è vuota). */
|
||||
/** Elimina e restituisce l'ultimo elemento della coda (null se <EFBFBD> vuota). */
|
||||
E removeLast();
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/**
|
||||
* Interfaccia per una coppia chiave-valore
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/** Una versione semplificata dell'interfaccia java.util.List. */
|
||||
public interface List<E> extends Iterable<E> {
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
public interface Position<E> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/** L'interfaccia che definisce liste posizionali. */
|
||||
public interface PositionalList<E> extends Iterable<E> {
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/**
|
||||
* Interfaccia per l' ADT coda prioritaria.
|
||||
@@ -1,20 +1,20 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
public interface Queue<E> {
|
||||
|
||||
/** Restituisce il numero di elementi presenti nella coda. */
|
||||
public int size();
|
||||
|
||||
/** Verifica se la coda è vuota. */
|
||||
/** Verifica se la coda <EFBFBD> vuota. */
|
||||
public boolean isEmpty();
|
||||
|
||||
/** Inserisce un elemento in fondo alla coda. */
|
||||
public void enqueue(E e);
|
||||
|
||||
/** Elimina e restituisce il primo elemento della coda (null se è vuota). */
|
||||
/** Elimina e restituisce il primo elemento della coda (null se <EFBFBD> vuota). */
|
||||
public E dequeue();
|
||||
|
||||
/** Restituisce il primo elemento della coda, senza toglierlo (null se è vuota). */
|
||||
/** Restituisce il primo elemento della coda, senza toglierlo (null se <EFBFBD> vuota). */
|
||||
public E first();
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/**
|
||||
* Una raccolta di oggetti che vengono inseriti e eliminati secondo il principio
|
||||
* last-in first-out. Anche se ha uno scopo simile, questa interfaccia è diversa da
|
||||
* last-in first-out. Anche se ha uno scopo simile, questa interfaccia <EFBFBD> diversa da
|
||||
* java.util.Stack
|
||||
*
|
||||
* @author fscotto
|
||||
@@ -17,8 +17,8 @@ public interface Stack<E> {
|
||||
int size();
|
||||
|
||||
/**
|
||||
* Verifica se la pila è vuota.
|
||||
* @return true se e solo se la pila è vuota
|
||||
* Verifica se la pila <EFBFBD> vuota.
|
||||
* @return true se e solo se la pila <EFBFBD> vuota
|
||||
*/
|
||||
boolean isEmpty();
|
||||
|
||||
@@ -31,13 +31,13 @@ public interface Stack<E> {
|
||||
|
||||
/**
|
||||
* Restituisce l'elemento in cima alla pila, senza eliminarlo.
|
||||
* @return l'elemento in cima alla pila (o null se la pila è vuota)
|
||||
* @return l'elemento in cima alla pila (o null se la pila <EFBFBD> vuota)
|
||||
*/
|
||||
E top();
|
||||
|
||||
/**
|
||||
* Elimina e restituisce l'elemento che si trova in cima alla pila.
|
||||
* @return l'elemento eliminato (o null se la pila è vuota)
|
||||
* @return l'elemento eliminato (o null se la pila <EFBFBD> vuota)
|
||||
*/
|
||||
E pop();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt;
|
||||
package org.fscotto.asd.adt;
|
||||
|
||||
/** Un albero i cui nodi possono avere un numero di figli arbitrario. */
|
||||
public interface Tree<E> extends Iterable<E> {
|
||||
@@ -1,6 +1,6 @@
|
||||
package it.algoritmi.adt.dequeue;
|
||||
package org.fscotto.asd.adt.dequeue;
|
||||
|
||||
import it.algoritmi.adt.Deque;
|
||||
import org.fscotto.asd.adt.Deque;
|
||||
|
||||
public class ArrayDeque<E> implements Deque<E> {
|
||||
private E[] data;
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.adt.dequeue;
|
||||
package org.fscotto.asd.adt.dequeue;
|
||||
|
||||
import it.algoritmi.adt.Deque;
|
||||
import it.algoritmi.adt.list.DoublyLinkedList;
|
||||
import org.fscotto.asd.adt.Deque;
|
||||
import org.fscotto.asd.adt.list.DoublyLinkedList;
|
||||
|
||||
public class LinkedDeque<E> implements Deque<E> {
|
||||
private DoublyLinkedList<E> l = new DoublyLinkedList<>();
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import it.algoritmi.adt.List;
|
||||
import org.fscotto.asd.adt.List;
|
||||
|
||||
public class ArrayList<E> implements List<E> {
|
||||
// variabili di esemplare
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
|
||||
public class CircularyLinkedList<E> {
|
||||
private Node<E> tail = null;
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
|
||||
public class DoublyLinkedList<E> {
|
||||
private Node<E> header;
|
||||
@@ -51,7 +51,7 @@ public class DoublyLinkedList<E> {
|
||||
return size;
|
||||
}
|
||||
|
||||
/** Restituisce true se e solo se la lista è vuota */
|
||||
/** Restituisce true se e solo se la lista <EFBFBD> vuota */
|
||||
public boolean isEmpty() {
|
||||
return size == 0;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import it.algoritmi.adt.Position;
|
||||
import it.algoritmi.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
|
||||
/** Gestisce una lista di elementi ordinati in base alla frequenza di accesso. */
|
||||
public class FavoritesList<E> {
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
|
||||
import it.algoritmi.adt.Position;
|
||||
import it.algoritmi.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
|
||||
/** Gestisce una lista di preferiti usando l'euristica move-to-front */
|
||||
public class FavoritesListMTF<E> extends FavoritesList<E> {
|
||||
@@ -1,10 +1,10 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import it.algoritmi.adt.Position;
|
||||
import it.algoritmi.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
|
||||
/** Implementazione di lista posizionale mediante lista doppiamente concatenata. */
|
||||
public class LinkedPositionalList<E> implements PositionalList<E> {
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.adt.list;
|
||||
package org.fscotto.asd.adt.list;
|
||||
|
||||
public class SinglyLinkedList<E> implements Cloneable {
|
||||
private Node<E> head = null;
|
||||
@@ -1,9 +1,9 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import it.algoritmi.adt.Entry;
|
||||
import it.algoritmi.adt.PriorityQueue;
|
||||
import org.fscotto.asd.adt.Entry;
|
||||
import org.fscotto.asd.adt.PriorityQueue;
|
||||
|
||||
public abstract class AbstractPriorityQueue<K extends Comparable<K>, V> implements PriorityQueue<K, V> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import it.algoritmi.adt.Queue;
|
||||
import org.fscotto.asd.adt.Queue;
|
||||
|
||||
public class ArrayQueue<E> implements Queue<E> {
|
||||
public static final int CAPACITY = 1000;
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import it.algoritmi.adt.Deque;
|
||||
import it.algoritmi.adt.Queue;
|
||||
import it.algoritmi.adt.dequeue.LinkedDeque;
|
||||
import org.fscotto.asd.adt.dequeue.LinkedDeque;
|
||||
import org.fscotto.asd.adt.Deque;
|
||||
import org.fscotto.asd.adt.Queue;
|
||||
|
||||
public class DoubleLinkedQueue<E> implements Queue<E> {
|
||||
private Deque<E> d = new LinkedDeque<>();
|
||||
@@ -1,9 +1,9 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import it.algoritmi.adt.AdaptablePriorityQueue;
|
||||
import it.algoritmi.adt.Entry;
|
||||
import org.fscotto.asd.adt.AdaptablePriorityQueue;
|
||||
import org.fscotto.asd.adt.Entry;
|
||||
|
||||
public class HeapAdaptablePriorityQueue<K extends Comparable<K>, V> extends HeapPriorityQueue<K, V>
|
||||
implements AdaptablePriorityQueue<K, V> {
|
||||
@@ -1,9 +1,9 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
|
||||
import it.algoritmi.adt.Entry;
|
||||
import org.fscotto.asd.adt.Entry;
|
||||
|
||||
public class HeapPriorityQueue<K extends Comparable<K>, V> extends AbstractPriorityQueue<K, V> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import it.algoritmi.adt.CircularQueue;
|
||||
import it.algoritmi.adt.list.CircularyLinkedList;
|
||||
import org.fscotto.asd.adt.CircularQueue;
|
||||
import org.fscotto.asd.adt.list.CircularyLinkedList;
|
||||
|
||||
public class LinkedCircularQueue<E> extends LinkedQueue<E> implements CircularQueue<E> {
|
||||
private CircularyLinkedList<E> list = new CircularyLinkedList<>();
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import it.algoritmi.adt.Queue;
|
||||
import it.algoritmi.adt.list.SinglyLinkedList;
|
||||
import org.fscotto.asd.adt.Queue;
|
||||
import org.fscotto.asd.adt.list.SinglyLinkedList;
|
||||
|
||||
public class LinkedQueue<E> implements Queue<E> {
|
||||
private SinglyLinkedList<E> list = new SinglyLinkedList<>();
|
||||
@@ -1,11 +1,11 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import it.algoritmi.adt.Entry;
|
||||
import it.algoritmi.adt.Position;
|
||||
import it.algoritmi.adt.PositionalList;
|
||||
import it.algoritmi.adt.list.LinkedPositionalList;
|
||||
import org.fscotto.asd.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.Entry;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
import org.fscotto.asd.adt.list.LinkedPositionalList;
|
||||
|
||||
public class SortedPriorityQueue<K extends Comparable<K>, V> extends AbstractPriorityQueue<K, V> {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package it.algoritmi.adt.queue;
|
||||
package org.fscotto.asd.adt.queue;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import it.algoritmi.adt.Entry;
|
||||
import it.algoritmi.adt.Position;
|
||||
import it.algoritmi.adt.PositionalList;
|
||||
import it.algoritmi.adt.list.LinkedPositionalList;
|
||||
import org.fscotto.asd.adt.PositionalList;
|
||||
import org.fscotto.asd.adt.Entry;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
import org.fscotto.asd.adt.list.LinkedPositionalList;
|
||||
|
||||
/** Un'implementazione di coda prioritaria mediante una lista non ordinata. */
|
||||
public class UnsortedPriorityQueue<K extends Comparable<K>, V> extends AbstractPriorityQueue<K, V> {
|
||||
@@ -1,6 +1,6 @@
|
||||
package it.algoritmi.adt.stack;
|
||||
package org.fscotto.asd.adt.stack;
|
||||
|
||||
import it.algoritmi.adt.Stack;
|
||||
import org.fscotto.asd.adt.Stack;
|
||||
|
||||
public class ArrayStack<E> implements Stack<E> {
|
||||
public static final int CAPACITY = 1000;
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.algoritmi.adt.stack;
|
||||
package org.fscotto.asd.adt.stack;
|
||||
|
||||
import it.algoritmi.adt.Deque;
|
||||
import it.algoritmi.adt.Stack;
|
||||
import it.algoritmi.adt.dequeue.LinkedDeque;
|
||||
import org.fscotto.asd.adt.dequeue.LinkedDeque;
|
||||
import org.fscotto.asd.adt.Deque;
|
||||
import org.fscotto.asd.adt.Stack;
|
||||
|
||||
public class DoubledLinkedStack<E> implements Stack<E> {
|
||||
private Deque<E> d = new LinkedDeque<>();
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.adt.stack;
|
||||
package org.fscotto.asd.adt.stack;
|
||||
|
||||
import it.algoritmi.adt.Stack;
|
||||
import it.algoritmi.adt.list.SinglyLinkedList;
|
||||
import org.fscotto.asd.adt.Stack;
|
||||
import org.fscotto.asd.adt.list.SinglyLinkedList;
|
||||
|
||||
public class LinkedStack<E> implements Stack<E> {
|
||||
private SinglyLinkedList<E> list = new SinglyLinkedList<>();
|
||||
@@ -1,10 +1,10 @@
|
||||
package it.algoritmi.adt.tree;
|
||||
package org.fscotto.asd.adt.tree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.algoritmi.adt.BinaryTree;
|
||||
import it.algoritmi.adt.Position;
|
||||
import org.fscotto.asd.adt.BinaryTree;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
|
||||
/** Una classe di base astratta che implementain parte l'interfaccia BinaryTree */
|
||||
public abstract class AbstractBinaryTree<E> extends AbstractTree<E> implements BinaryTree<E> {
|
||||
@@ -1,12 +1,12 @@
|
||||
package it.algoritmi.adt.tree;
|
||||
package org.fscotto.asd.adt.tree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.algoritmi.adt.Position;
|
||||
import it.algoritmi.adt.Queue;
|
||||
import it.algoritmi.adt.Tree;
|
||||
import it.algoritmi.adt.queue.LinkedQueue;
|
||||
import org.fscotto.asd.adt.Tree;
|
||||
import org.fscotto.asd.adt.queue.LinkedQueue;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
import org.fscotto.asd.adt.Queue;
|
||||
|
||||
/** Una classe di base astratta che implementa in parte l'interfaccia Tree. */
|
||||
public abstract class AbstractTree<E> implements Tree<E> {
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.algoritmi.adt.tree;
|
||||
package org.fscotto.asd.adt.tree;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import it.algoritmi.adt.Position;
|
||||
import org.fscotto.asd.adt.Position;
|
||||
|
||||
/** Implementazione concreta di albero binario usando nodi concatenati. */
|
||||
public class LinkedBinaryTree<E> extends AbstractBinaryTree<E> {
|
||||
@@ -1,11 +1,11 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
import it.algoritmi.adt.Deque;
|
||||
import it.algoritmi.adt.Queue;
|
||||
import it.algoritmi.adt.Stack;
|
||||
import it.algoritmi.adt.dequeue.ArrayDeque;
|
||||
import it.algoritmi.adt.queue.LinkedQueue;
|
||||
import it.algoritmi.adt.stack.ArrayStack;
|
||||
import org.fscotto.asd.adt.dequeue.ArrayDeque;
|
||||
import org.fscotto.asd.adt.queue.LinkedQueue;
|
||||
import org.fscotto.asd.adt.stack.ArrayStack;
|
||||
import org.fscotto.asd.adt.Deque;
|
||||
import org.fscotto.asd.adt.Queue;
|
||||
import org.fscotto.asd.adt.Stack;
|
||||
|
||||
public class ADTs {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
import it.algoritmi.adt.Stack;
|
||||
import it.algoritmi.adt.stack.LinkedStack;
|
||||
import org.fscotto.asd.adt.stack.LinkedStack;
|
||||
import org.fscotto.asd.adt.Stack;
|
||||
|
||||
public class ArithmeticMatcher {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
public class CaesarCipher {
|
||||
protected char[] encoder = new char[26];
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
public class CreditCard {
|
||||
private String customer;
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
import it.algoritmi.adt.Stack;
|
||||
import it.algoritmi.adt.stack.LinkedStack;
|
||||
import org.fscotto.asd.adt.stack.LinkedStack;
|
||||
import org.fscotto.asd.adt.Stack;
|
||||
|
||||
public class HTMLMatcher {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
import it.algoritmi.adt.CircularQueue;
|
||||
import it.algoritmi.adt.queue.LinkedCircularQueue;
|
||||
import org.fscotto.asd.adt.queue.LinkedCircularQueue;
|
||||
import org.fscotto.asd.adt.CircularQueue;
|
||||
|
||||
public class Josephus {
|
||||
/** Determina il vincitore del problema di Josephus usando una coda circolare. */
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.algoritmi.test;
|
||||
package org.fscotto.asd.demo;
|
||||
|
||||
public class PredatoryCreditCard extends CreditCard {
|
||||
private double rate;
|
||||
Reference in New Issue
Block a user