Skip to content

custom-set: Add generator #585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2018
Merged
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
6 changes: 3 additions & 3 deletions exercises/custom-set/.meta/hints.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Hints
This exercise requires you to implements a type-specific method for determining equality of instances.
For more information, see [this page]
(https://docs.microsoft.com/en-us/dotnet/core/api/System.IEquatable-1) .

This exercise requires you to create custom equality comparison logic.
For more information, see [this page](https://docs.microsoft.com/en-us/dotnet/api/system.object.equals?view=netcore-2.0#System_Object_Equals_System_Object_).
59 changes: 10 additions & 49 deletions exercises/custom-set/CustomSet.cs
Original file line number Diff line number Diff line change
@@ -1,88 +1,49 @@
using System;
using System.Collections;
using System.Collections.Generic;

public class CustomSet<T> : IEnumerable<T>, IEquatable<IEnumerable<T>>
public class CustomSet
{
public CustomSet()
{
}

public CustomSet(T value)
{
}

public CustomSet(IEnumerable<T> values)
{
}

public CustomSet<T> Insert(T value)
{
throw new NotImplementedException("You need to implement this function.");
}

public bool IsEmpty()
public CustomSet(params int[] values)
{
throw new NotImplementedException("You need to implement this function.");
}

public bool Contains(T value)
public CustomSet Insert(int value)
{
throw new NotImplementedException("You need to implement this function.");
}

public bool IsSubsetOf(CustomSet<T> right)
public bool Empty()
{
throw new NotImplementedException("You need to implement this function.");
}

public bool IsDisjointFrom(CustomSet<T> right)
public bool Contains(int value)
{
throw new NotImplementedException("You need to implement this function.");
}

public CustomSet<T> Intersection(CustomSet<T> right)
public bool Subset(CustomSet right)
{
throw new NotImplementedException("You need to implement this function.");
}

public CustomSet<T> Difference(CustomSet<T> right)
public bool Disjoint(CustomSet right)
{
throw new NotImplementedException("You need to implement this function.");
}

public CustomSet<T> Union(CustomSet<T> right)
public CustomSet Intersection(CustomSet right)
{
throw new NotImplementedException("You need to implement this function.");
}

public IEnumerator<T> GetEnumerator()
public CustomSet Difference(CustomSet right)
{
throw new NotImplementedException("You need to implement this function.");
}

IEnumerator IEnumerable.GetEnumerator()
public CustomSet Union(CustomSet right)
{
throw new NotImplementedException("You need to implement this function.");
}

public override bool Equals(object obj)
{
throw new NotImplementedException("You need to implement this function.");
}

public override int GetHashCode()
{
throw new NotImplementedException();
}

public bool Equals(IEnumerable<T> other)
{
throw new NotImplementedException("You need to implement this function.");
}

public int GetHashCode(IEnumerable<T> obj)
{
throw new NotImplementedException();
}
}
Loading