code: def is_palindrome_stack(head):
      if not head or not head.next:
          return True
  
      # 1. Get the midpoint (slow)
      slow = fast = cur = head
      while fast and fast.next:
          fast, slow = fast.next.next, slow.next
  
      # 2. Push the second half into the stack
      stack = [slow.val]
      while slow.next:
          slow = slow.next
          stack.append(slow.val)
  
      # 3. Comparison
      while stack:
          if stack.pop() != cur.val:
              return False
          cur = cur.next
  
      return True
  
label_desc: Use image node_id 2 for calling a global function with example usage: is_palindrome_stack(head) and returns: True, True, False