title: Height Complete Binary Tree Heap N Nodes
signature: height_complete_binary_tree_heap_n_nodes <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          65L, 
          6L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          94L, 
          6L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          52L, 
          5L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          31L, 
          4L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          9L, 
          3L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          1L, 
          0L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          41L, 
          5L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          98L, 
          6L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          45L, 
          5L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          24L, 
          4L
      )))
  
  }
  
  main()
source_py: def height_complete_binary_tree_heap_n_nodes(N):
      return (math.ceil(math.log2((N + 1))) - 1)
source_cpp: int height_complete_binary_tree_heap_n_nodes(int N) {
    return ceil ( log2 ( N + 1 ) ) - 1;
  }