Tag: python
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 …
August 31, 2020
algorithms, Binary Tree, c / c++, C/C++, code, data structure, interviews, Java, programming languages, Python
A Binary Search Tree (BST) is a commonly used data structure that can be used to search for an item in O(LogN) time. A BST has the following characteristics: …