摘要: Pattern searching requires two base components: A text to scan A pattern to search for In our naive search, we can imagine the text being scanned as o 阅读全文
posted @ 2022-01-24 17:12 M1stF0rest 阅读(29) 评论(0) 推荐(0) 编辑
摘要: Instead of timing a program, through asymptotic notation, we can calculate a program’s runtime by looking at how many instructions the computer has to 阅读全文
posted @ 2022-01-23 22:18 M1stF0rest 阅读(27) 评论(0) 推荐(0) 编辑
摘要: Recursion VS Iteration Below is an example of counting the depth of a binary tree using both iteration and recursion. #Implementation using iteration: 阅读全文
posted @ 2022-01-19 16:41 M1stF0rest 阅读(24) 评论(0) 推荐(0) 编辑
摘要: In programming, recursion means a function definition will include an invocation of the function within its own body. Call Stacks and Execution Frames 阅读全文
posted @ 2022-01-18 21:03 M1stF0rest 阅读(22) 评论(0) 推荐(0) 编辑
摘要: This is a python implementation of a hash map with the method of open addressing (linear probing) facing the collision class HashMap: def __init__(sel 阅读全文
posted @ 2022-01-16 22:14 M1stF0rest 阅读(24) 评论(1) 推荐(0) 编辑
摘要: Being a map means relating two pieces of information (key to value), but a map in data structure also has one further requirement. In order for a rela 阅读全文
posted @ 2022-01-15 22:35 M1stF0rest 阅读(29) 评论(0) 推荐(0) 编辑
摘要: from stack import Stack print("\nLet's play Towers of Hanoi!!") #Create the Stacks stacks = [] left_stack = Stack("Left") middle_stack = Stack("Middle 阅读全文
posted @ 2022-01-14 23:07 M1stF0rest 阅读(29) 评论(1) 推荐(0) 编辑
摘要: A stack is a data structure which contains an ordered set of data. Stacks provide three methods for interaction: Push - adds data to the “top” of the 阅读全文
posted @ 2022-01-13 21:43 M1stF0rest 阅读(32) 评论(1) 推荐(0) 编辑
摘要: A queue is a data structure which contains an ordered set of data. Queues provide three methods for interaction: Enqueue - adds data to the “back” or 阅读全文
posted @ 2022-01-12 16:53 M1stF0rest 阅读(33) 评论(0) 推荐(0) 编辑
摘要: Double-linked-list is also composed of a series of nodes. It has the following attributes: Are comprised of nodes that contain links to the next and p 阅读全文
posted @ 2022-01-11 23:09 M1stF0rest 阅读(27) 评论(0) 推荐(0) 编辑