Friedrich Ewald My Personal Website

Posts


  • Leetcode: Validate Binary Search Tree

    Given the root node of a tree, validate whether it is a valid Binary Search Tree. This is a tree where each node is unique, left children are smaller than the root and right children are greater than the root.

    Continue reading

  • Leetcode: Palindrome partitioning

    Given a string s, return a list containing of all possible partitions of that string that are palindromes. A palindrome is a string that is the same backwards as forwards. For example, abba is a palindrome. The string aab can be partitioned as follows: [['a','a','b'], ['aa','b']]. This is because a single character is by definition a palindrome.

    Continue reading

  • Leetcode: Remove element from list

    Given the head of a linked list, remove all items with val. Afterwards, return the new head.

    Continue reading

  • Leetcode: Remove element

    Given an array nums, delete all items that are equal to val. Return the total number of remaining items and perform the deletion in place.

    Continue reading

  • Leetcode: Binary tree zigzag level order traversal

    Traverse a tree where the root node is given with a zig-zag level and return the values in a list with one entry per level. For example:

    -->    3
        /     \
       9       5      <--
            /     \
    -->    7       8
    
    Returns: [[3], [5,9], [7,8]]

    Continue reading

Page: 4 of 27