Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Mobile Tools for Java (J2ME)
.mtj.tmp/

build/*
.gradle/*
*.iml

# Package Files #
*.jar
*.war
Expand Down
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
group 'org'
version '1.0-SNAPSHOT'

apply plugin: 'java'

repositories {
mavenCentral()
}

dependencies {
compile 'org.jetbrains:annotations:15.0'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

неиспользуемые зависимости должны быть удалены

compile 'com.googlecode.json-simple:json-simple:1.1'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Feb 14 15:03:16 MSK 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip
164 changes: 164 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = 'hw02'

15 changes: 15 additions & 0 deletions src/main/java/sp/StreamSerializable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package sp;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public interface StreamSerializable {

void serialize(OutputStream out) throws IOException;

/**
* Replace current state with data from input stream
*/
void deserialize(InputStream in) throws IOException;
}
32 changes: 32 additions & 0 deletions src/main/java/sp/Trie.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package sp;

public interface Trie {

/**
* Expected complexity: O(|element|)
* @return <tt>true</tt> if this set did not already contain the specified
* element
*/
boolean add(String element);

/**
* Expected complexity: O(|element|)
*/
boolean contains(String element);

/**
* Expected complexity: O(|element|)
* @return <tt>true</tt> if this set contained the specified element
*/
boolean remove(String element);

/**
* Expected complexity: O(1)
*/
int size();

/**
* Expected complexity: O(|prefix|)
*/
int howManyStartsWithPrefix(String prefix);
}
Loading