oyekanmiayo / dsa-all-langs

A repository that contains explanations and (custom) implementations of the most popular data structures and algorithms in various languages.
MIT License
318 stars 120 forks source link

Implemented the list class in C# #52

Closed OjewaleKehinde closed 7 months ago

OjewaleKehinde commented 2 years ago

Added extra methods(InsertRange, Count, AddRange)

OjewaleKehinde commented 2 years ago

Alright. Noted. I'll add a main method to test it. Should I add print statements to print the results of each tests case, or I should only include the code for the tests?

On Fri, 23 Sep 2022, 09:14 Ayomide Oyekanmi, @.***> wrote:

@.**** commented on this pull request.

In list/java/List.java https://github.com/oyekanmiayo/data-structures-all-langs/pull/52#discussion_r978378465 :

@@ -1,6 +1,7 @@ /**

  • @author: Ayomide Oyekanmi */

Please remove this new line.

— Reply to this email directly, view it on GitHub https://github.com/oyekanmiayo/data-structures-all-langs/pull/52#pullrequestreview-1118074259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNKYMBCSWQSHQR3WJXQLFTV7VRG3ANCNFSM6AAAAAAQTNQP2Q . You are receiving this because you authored the thread.Message ID: @.*** com>

oyekanmiayo commented 2 years ago

I'm not sure what you mean by "I should only include the code for the tests". Ideally, you'll do something like

List<Integer> list = new List();
list.add(2) // {2}
list.add(0, 50) // {50, 2}

... and so on

I should also be able to copy out your code, paste it into Replit and run it immediately (please ensure that is so :)).

Nit: Please use a linter to format this file. NB: I haven't looked at your actual implementation yet; I'll do that later :). So, expects comments around that when I do.

OjewaleKehinde commented 2 years ago

Alright. I'll do that. What I was trying to ask was whether I should add print statements that display the items in the list to show that the methods perform as expected. For example, after List.Add(2) and List.Add(5), should I print the items in the resulting list to indeeed show that the items were added at the right indexes? Or should I just stop at calling the implementation of the methods, without printing to see what the items in the list are. Please let me know if my question is still unclear.

On Fri, 23 Sep 2022, 12:32 Ayomide Oyekanmi, @.***> wrote:

I'm not sure what you mean by "I should only include the code for the tests". Ideally, you'll do something like

List list = new List();list.add(2) // {2}list.add(0, 50) // {50, 2}

... and so on

I should also be able to copy out your code, paste it into Replit and run it immediately (please ensure that is so :)).

Nit: Please use a linter to format this file. NB: I haven't looked at your actual implementation yet; I'll do that later :). So, expects comments around that when I do.

— Reply to this email directly, view it on GitHub https://github.com/oyekanmiayo/data-structures-all-langs/pull/52#issuecomment-1256097975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNKYMASVLCPLH42DHC7GB3V7WILNANCNFSM6AAAAAAQTNQP2Q . You are receiving this because you authored the thread.Message ID: @.***>

oyekanmiayo commented 2 years ago

As I showed in my previous comment, you only need to show in the comments beside the call what the state of the list is after the call.

OjewaleKehinde commented 2 years ago

I have added the test cases. Kindly review. I have also removed the new line from the java file.

oyekanmiayo commented 2 years ago

Pls remove the LinkedList implementations from this PR.

It'll make the PR too big and a PR should focus on just one thing. Open another PR for them

oyekanmiayo commented 2 years ago

Oh and it looks like there's another PR for C#, so that'll take precedence.

oyekanmiayo commented 2 years ago

I (or Abdulazeez) will review the other PR and you can add to that if you want (for the LLs).

Although, on slack what I meant was that you should create a PR to update the README for LL with the possible optimizations you proposed. We can talk about it on slack before you do that, if you're interested.

OjewaleKehinde commented 2 years ago

I (or Abdulazeez) will review the other PR and you can add to that if you want (for the LLs).

Although, on slack what I meant was that you should create a PR to update the README for LL with the possible optimizations you proposed. We can talk about it on slack before you do that, if you're interested.

Alright. Should I send you a message on slack then?

OjewaleKehinde commented 2 years ago

Okay

On Sat, 1 Oct 2022, 12:40 Ayomide Oyekanmi, @.***> wrote:

Pls remove the LinkedList implementations from this PR.

It'll make the PR too big and a PR should focus on just one thing. Open another PR for them

— Reply to this email directly, view it on GitHub https://github.com/oyekanmiayo/data-structures-all-langs/pull/52#issuecomment-1264337905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNKYMG5XL6CBD53LVQ3VN3WBAPMFANCNFSM6AAAAAAQTNQP2Q . You are receiving this because you authored the thread.Message ID: @.***>