01 2022 档案

摘要:Bubble Sort: Bubble sort is an algorithm to sort a list through repeated swaps of adjacent elements. It has a runtime of O(n^2). For nearly sorted lis 阅读全文
posted @ 2022-01-26 21:03 M1stF0rest 阅读(33) 评论(0) 推荐(0) 编辑
摘要: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 阅读(36) 评论(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 阅读(29) 评论(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 阅读(25) 评论(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 阅读(25) 评论(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 阅读(26) 评论(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 阅读(30) 评论(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 阅读(31) 评论(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 阅读(34) 评论(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 阅读(35) 评论(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 阅读(29) 评论(0) 推荐(0) 编辑
摘要:I was busy with dealing with something else the other day, but I will continue in this blog from now on :) This time I will talk about another techniq 阅读全文
posted @ 2022-01-10 21:34 M1stF0rest 阅读(26) 评论(0) 推荐(0) 编辑
摘要:Linked List is composed of a series of nodes. The list is terminated when a node's link is null. The last node in this linked list is called the 'tail 阅读全文
posted @ 2022-01-03 22:26 M1stF0rest 阅读(25) 评论(0) 推荐(0) 编辑
摘要:An individual node contains two type of things: data it stores and links to other nodes. The link or links within the nodes are sometimes referred as 阅读全文
posted @ 2022-01-02 21:25 M1stF0rest 阅读(48) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示