Skip to content

Instantly share code, notes, and snippets.

Yurii Litvinov yurii-litvinov

Block or report user

Report or block yurii-litvinov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yurii-litvinov
yurii-litvinov / DoubleList.cpp
Created Oct 24, 2017
Double-linked list implementation from programming class
View DoubleList.cpp
#include "DoubleList.h"
struct DoubleListElement
{
double value = 0.0;
DoubleListElement* prev = nullptr;
DoubleListElement* next = nullptr;
};
struct DoubleList
View SmartListTest.java
import org.junit.Test;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import static org.junit.Assert.*;
public class SmartListTest {
View AmbiguousImplementationException.java
package task;
public class AmbiguousImplementationException extends Exception {
}
@yurii-litvinov
yurii-litvinov / Album.java
Last active Feb 12, 2019
Практика по Stream API
View Album.java
package com.example.streams;
import java.util.Arrays;
import java.util.List;
public class Album {
private final String name;
private final List<Track> tracks;
private final Artist artist;
View MyTreeSet.java
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
public interface MyTreeSet<E> extends Set<E> {
/** {@link TreeSet#descendingIterator()} **/
Iterator<E> descendingIterator();
/** {@link TreeSet#descendingSet()} **/
@yurii-litvinov
yurii-litvinov / HashMultiset.java
Created Oct 12, 2016
One possible solution for Multiset test
View HashMultiset.java
package com.example;
import org.jetbrains.annotations.NotNull;
import java.util.*;
/**
* Implements multiset based on LinkedHashMap class.
* @param <E> Type of stored elements.
*/
@yurii-litvinov
yurii-litvinov / HashMultisetTest.java
Created Oct 5, 2016
Unit tests for HashMultiset class
View HashMultisetTest.java
package task;
import org.junit.Test;
import java.util.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.junit.Assert.*;
View Multiset.java
package task;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
public interface Multiset<E> extends Collection<E> {
/**
* Returns the number of occurrences of an element in this multiset.
@yurii-litvinov
yurii-litvinov / example4-4.cs
Created Apr 14, 2016
code review example 4 - NodeOperation.cs
View example4-4.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ParseTree
{
public class NodeOperation : Node
{
private Node left;
@yurii-litvinov
yurii-litvinov / example4-3.cs
Created Apr 14, 2016
code review example 4 - NodeOperand.cs
View example4-3.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ParseTree
{
public class NodeOperand : Node
{
private double value;
You can’t perform that action at this time.