data-structures-all-langs icon indicating copy to clipboard operation
data-structures-all-langs copied to clipboard

Implemented the list class in C#

Open OjewaleKehinde opened this issue 2 years ago • 10 comments

Added extra methods(InsertRange, Count, AddRange)

OjewaleKehinde avatar Sep 22 '22 20:09 OjewaleKehinde

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>

OjewaleKehinde avatar Sep 23 '22 09:09 OjewaleKehinde

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.

oyekanmiayo avatar Sep 23 '22 11:09 oyekanmiayo

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<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.

— 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: @.***>

OjewaleKehinde avatar Sep 23 '22 14:09 OjewaleKehinde

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.

oyekanmiayo avatar Sep 23 '22 15:09 oyekanmiayo

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

OjewaleKehinde avatar Sep 23 '22 23:09 OjewaleKehinde

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 avatar Oct 01 '22 11:10 oyekanmiayo

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

oyekanmiayo avatar Oct 01 '22 11:10 oyekanmiayo

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.

oyekanmiayo avatar Oct 01 '22 14:10 oyekanmiayo

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 avatar Oct 01 '22 14:10 OjewaleKehinde

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: @.***>

OjewaleKehinde avatar Oct 11 '22 07:10 OjewaleKehinde