7 kyu

Linked Lists - Move Node

705 of 1,774JDeBolt
Description
Loading description...
Linked Lists
Data Structures
Fundamentals
  • Please sign in or sign up to leave a comment.
  • LosBlobbos Avatar

    CoffeeScript translation (language agnostic description)

  • Haksell Avatar

    Maybe I'm missing something but I think the Python version could return a tuple of two nodes instead of the weird context thing.

  • yellowBirdy Avatar

    I'm passing all the tests but the last subtest of empty destination, which I am also not able to figure what is it actually asserting as the failure specifies only

    • Expected: null, instead got: 0

    While no data value equals 0, nor even there is a list of length one. Below ther is a log of my returned context object

    Context {
      source: Node { data: 2, next: Node { data: 3, next: null } },
    dest: Node { data: 1, next: null } }
    
  • cliffstamp Avatar

    Ruby :

    • does not test for empty source

    "You should throw an error when the source list is empty. "

  • donaldsebleung Avatar

    This comment has been hidden.

  • donaldsebleung Avatar

    [Python, Ruby, Swift] Needs random test cases

  • marko-bekhta Avatar

    added Java translation

  • wind-of-flowers Avatar

    For me not enough explanation.

    I get an error in this test: move_node([1, 2, 3, None], None)

    In my solution its equal Context([2, 3, None], Node(1)) and all fine, but i get an error: <__main__.Node object at 0x7fb1cde74ba8> should equal None

    I check: move_node([1, 2, 3, None], None).source move_node([1, 2, 3, None], None).dest.data move_node([1, 2, 3, None], None).dest.next all fine and equal to Context([2, 3, None], Node(1))

    Where my error?

  • hpartidas Avatar

    For those having trouble, refer to the LinkedLists documentation provided. It helped me understand the task at hand since there was no explanation anywhere else. The missing functions and everything are in the pdf.

    Here is the link for it: http://cslibrary.stanford.edu/103/LinkedListBasics.pdf

  • roninjs Avatar

    I don't really understand linked lists nor do I understand the test cases as they are calling functions not in the code. I've tried using array methods a they are not defined can you point me to some info about this subject I will study and come back?

    Thanks

  • myrc Avatar

    This comment has been hidden.

  • sperrow Avatar

    Got this kata randomly so I didn't initially realize the linked list methods were defined in other katas, would be helpful to call that out. Also would be good to clarify the code given is pseudocode.

  • NaMe613 Avatar

    CoffeScript and Ruby translations kumited.