Skip to content

CSharp example #18

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

MaxMelnik
Copy link

No description provided.

@MaxMelnik MaxMelnik changed the title Updated printList method for DoubleLinkedList CSharp example Jun 1, 2017
MaxMelnik added 3 commits June 1, 2017 20:40
1. Changed access modifier of Node fields
2. Updated return functions
@GYFK GYFK requested a review from Raixur June 6, 2017 21:52
Copy link

@Raixur Raixur left a comment

Choose a reason for hiding this comment

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

  • You may add a reference on head/first element to keep order in which element was added.
  • Lists should implement at least IEnumerable interface.
  • You may add some functionality to your classes, e.g. Contains, Remove, Count methods. Also, you may overload index operator.

{
internal T item;
internal Node next;
internal Node previous;
Copy link

Choose a reason for hiding this comment

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

Modifier can be public because class Node is inner private, so fields can be accessed only in DoubleLinkedList class scope.

{
List<T> res = new List<T>();
Node temp = last;
T item = default(T);
Copy link

Choose a reason for hiding this comment

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

No need for item initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants