00:19:42 Davide Marincione: As always, the non-slicing version def is_sorted(lst, indx=1): if len(lst) <= indx: return True if lst[indx - 1] <= lst[indx]: return is_sorted(lst, indx + 1) else: return False 00:26:02 Alessandro vecchi: I think we need the <= otherwise a list 1,2,3,4,5,5 will return False 00:26:39 Tommaso Di Mario: It is actually false 00:26:51 Davide Loriga: depends if we're trying to check a strict increase or an increase in general, so it might more like what you're saying 00:26:51 Tommaso Di Mario: I think he means strictly increasing 00:50:48 Stefano Colonnelli: can a node have only another node? 01:00:17 Alessio Borgi: Is there a way to visualize the Whole tree? 01:02:48 Alessandro vecchi: I think that if you play with \n and \t you can print the tree in the console 01:12:02 Alessandro vecchi: Sorry sir but shouldn’t we assign a value to found? 01:12:37 Alessandro vecchi: Ok nevermind 01:20:01 Alessandro vecchi: Sorry prof but I didn’t understand where are we summing the leaves 01:20:24 Alessandro vecchi: The leaves of different roots 01:25:43 Alessio Borgi: shouldn't we set if not tree.left or not tree.right(instead of "and")? 01:26:19 Alessandro vecchi: Oh so he stores the value during the recursion 01:26:22 Alessandro vecchi: magic 01:29:07 Alessandro vecchi: Clear thanks 01:37:22 simone cargnin: can you scroll up the program 01:37:23 simone cargnin: ? 01:39:34 Paolo Gigliesi: Sorry professor, to work again in a similar way, shouldn't we know at least the number of branches? 01:39:40 Paolo Gigliesi: I mean 01:40:14 Federica Valeau: Professor I'm sorry, could you zoom a bit on the text please? And also, the hw8 just came out, could you clarify some passages later? 01:40:16 Paolo Gigliesi: what would happen if we find a not homogeneous tree? 01:41:34 simone cargnin: explain not homogeneus tree 01:42:03 Paolo Gigliesi: a branch with 3 or more paths 01:42:13 Paolo Gigliesi: not only left and right 01:42:35 simone cargnin: it's a binary tree 01:42:39 simone cargnin: max 2 path 01:42:50 simone cargnin: prof but when we create the tree? 01:43:39 Paolo Gigliesi: Yes Ik, I was just asking for other cases 01:44:26 Paolo Gigliesi: nvm if they are not relevant at all 01:44:58 Paolo Gigliesi: ,* 02:00:14 Alessandro vecchi: Why are we summing two times \t*level? 02:03:26 Alessio Borgi: Could you zoom a little bit? 02:06:38 Alessandro vecchi: I think we have to sum to the initialization of the string a ‘\n’ 02:07:55 Alessandro vecchi: Yeah two times 02:17:31 simone cargnin: finally 02:17:41 simone cargnin: thath red bothered me so much 02:19:10 simone cargnin: wait can you make some example? 02:19:46 simone cargnin: ok superclear 02:21:17 simone cargnin: maybe we can do with find, count how many function we call? 02:21:28 simone cargnin: something like thath 02:21:35 simone cargnin: i'm not sure 02:26:33 Alessandro vecchi: if not tree.left and not tree.right: return 0 height, height2 = 0, 0 if tree.left: height = max_path_leaf(tree.left) if tree.right: height2 = max_path_leaf(tree.right) if height>height2: return height+1 else: return height2+1 02:26:50 Davide Marincione: Something like this def max_path(tree): ret = 1 if tree.left: ret += max_path(tree.left) if tree.right and ret < (foo:= max_path(tree.right)): ret = 1 + foo return ret 02:31:04 Davide Marincione: (mine would give level by counting from 1 though) 02:45:27 Ginevra Cepparulo: So you want to add it to the leaf with the min level? 02:53:08 Alessandro vecchi: We have to initialize ml and mr as always I think 03:03:03 Alessandro vecchi: Perfect thanks 03:03:28 Alessandro vecchi: yep 03:04:35 Gabriele Scognamiglio: Sounds good 03:04:42 Paolo Gigliesi: Perfect. Thanks 03:04:57 Alessandro vecchi: Will we do a sort of ‘simulation of the exam’ online? 03:05:36 Gabriele Scognamiglio: Thank you, bye 03:05:39 Nicholas Tiveron: Perfect, thanks. Bye! 03:05:39 Paolo Gigliesi: Goodbye! 03:05:41 Tassybayev Sauryk: bye) 03:05:43 Giuseppina Iannotti: Thanks bye 03:05:45 Ginevra Cepparulo: goodbye 03:05:46 Alessandro vecchi: Thanks bye!