Sort by

recency

|

998 Discussions

|

  • + 0 comments

    def reversePrint(llist): # Write your code here curr = llist if curr is None: return reversePrint(curr.next) print(curr.data)

  • + 2 comments

    I was working on this reverse-print linked list problem, and the way I understood it was by comparing it to the Denny’s breakfast menu. You don’t change anything on the menu, you just read it from the bottom instead of the top. Same with the list: go to the end first, then print everything backward.Select 44 more words to run Humanizer.

  • + 0 comments

    implementation in TypeScript

    function reversePrint(llist: SinglyLinkedListNode): void {
        if(llist === null ) return;
        reversePrint(llist.next!)
        console.log(llist.data)
     
    }
    
  • + 0 comments

    def reversePrint(llist): # Write your code here

    if llist.next:
        reversePrint(llist.next)
    print(llist.data)
    
  • + 0 comments

    Golang Solution with recursive:

    func reversePrint(llist *SinglyLinkedListNode) {
        if llist.next != nil {
            reversePrint(llist.next)
        }
        fmt.Println(llist.data)
    }