1 //===-- main.cpp ------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include <stdio.h> 10 #include <stdlib.h> 11 #include <stdint.h> 12 13 struct node; 14 struct node { 15 int value; 16 node* next; 17 node () : value(1),next(NULL) {} 18 node (int v) : value(v), next(NULL) {} 19 }; 20 21 void make_tree(node* root, int count) 22 { 23 int countdown=1; 24 if (!root) 25 return; 26 root->value = countdown; 27 while (count > 0) 28 { 29 root->next = new node(++countdown); 30 root = root->next; 31 count--; 32 } 33 } 34 35 int main (int argc, const char * argv[]) 36 { 37 node root(1); 38 make_tree(&root,25000); 39 return 0; // Set break point at this line. 40 } 41