Tag: python
Teaching Kids Programming: Videos on Data Structures and Algorithms Linear Search Algorithm to Find Square Root Taking sqrt(n) for example, the linear search (a kind of a bruteforce search …
Teaching Kids Programming: Videos on Data Structures and Algorithms The factorial function f(n) implemented in Python using Recursion: def f(n): if n == 1: return 1 return n * …
Given a positive integer num, return the sum of its digits. Bonus: Can you do it without using strings? Example 1 Input num = 123 Output 6 Explanation Since …
Have the function TreeConstructor(strArr) take the array of strings stored in strArr, which will contain pairs of integers in the following format: (i1,i2), where i1 represents a child node …
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter …