随笔分类 -  Algorithms

上一页 1 ··· 4 5 6 7 8 9 下一页
摘要:Let's say we have two strings: str1 = 'ACDEB' str2 = 'AEBC' We need to find the longest common subsequence, which in this case should be 'AEB'. Using 阅读全文
posted @ 2019-01-01 23:01 Zhentiw 阅读(259) 评论(0) 推荐(0)
摘要:The k-nearest neighbors algorithm is used for classification of unknown items and involves calculating the distance of the unknown item's neighbors. W 阅读全文
posted @ 2018-12-28 20:09 Zhentiw 阅读(166) 评论(0) 推荐(0)
摘要:Every dynamic programming algorithm starts with a grid. It entails solving subproblems and builds up to solving the big problem. Let’s break down a pr 阅读全文
posted @ 2018-12-26 03:22 Zhentiw 阅读(209) 评论(0) 推荐(0)
摘要:Binary search is an algorithm that accepts a sorted list and returns a search element from the list. It provides a dramatic performance boost over sea 阅读全文
posted @ 2018-12-23 04:07 Zhentiw 阅读(206) 评论(0) 推荐(0)
摘要:Merge sort is a recursive sorting algorithm. If you don't understand recursion, I recommend finding a resource to learn it. In brief, recursion is the 阅读全文
posted @ 2018-12-22 06:04 Zhentiw 阅读(266) 评论(0) 推荐(0)
摘要:nsertion sort is another sorting algorithm that closely resembles how we might sort items in the physical world. We start at the second item in our co 阅读全文
posted @ 2018-12-21 05:46 Zhentiw 阅读(250) 评论(0) 推荐(0)
摘要:A binary tree is a tree where each node may only have up to two children. These children are stored on the leftand right properties of each node. When 阅读全文
posted @ 2018-12-20 04:22 Zhentiw 阅读(290) 评论(0) 推荐(0)
摘要:Quicksort (also called partition sort and pivot sort) is arguably the most used sorting algorithm. It is the one commonly implemented internally in la 阅读全文
posted @ 2018-12-18 21:50 Zhentiw 阅读(574) 评论(0) 推荐(0)
摘要:In a tree, nodes have a single parent node and may have many children nodes. They never have more than one parent nor point to any siblings. The most 阅读全文
posted @ 2018-12-18 04:58 Zhentiw 阅读(264) 评论(0) 推荐(0)
摘要:Depth first search is a graph search algorithm that starts at one node and uses recursion to travel as deeply down a path of neighboring nodes as poss 阅读全文
posted @ 2018-12-17 02:19 Zhentiw 阅读(589) 评论(0) 推荐(0)
摘要:Recursion is when a function calls itself. This self calling function handles at least two cases, the recursive case and the base case. People seem to 阅读全文
posted @ 2018-12-17 02:02 Zhentiw 阅读(129) 评论(0) 推荐(0)
摘要:Breadth first search is a graph search algorithm that starts at one node and visits neighboring nodes as widely as possible before going further down 阅读全文
posted @ 2018-12-15 17:33 Zhentiw 阅读(498) 评论(0) 推荐(0)
摘要:A graph is a data structure comprised of a set of nodes, also known as vertices, and a set of edges. Each node in a graph may point to any other node 阅读全文
posted @ 2018-12-15 03:06 Zhentiw 阅读(290) 评论(0) 推荐(0)
摘要:A linked list is a collection of items where each item points to the next one in the list. Because of this structure, linked lists are very slow when 阅读全文
posted @ 2018-12-14 00:07 Zhentiw 阅读(257) 评论(0) 推荐(0)
摘要:A stack is a collection of items that obeys the principle of "last in, first out". Like a stack of plates, we can only access the topmost plate at any 阅读全文
posted @ 2018-12-13 06:06 Zhentiw 阅读(246) 评论(0) 推荐(0)
摘要:In this lesson, you will learn how to create a queue in JavaScript. A queue is a first-in, first-out data structure (FIFO). We can only remove items f 阅读全文
posted @ 2018-12-12 06:21 Zhentiw 阅读(204) 评论(0) 推荐(0)
摘要:Insertion sort is a very intuitive algorithm as humans use this pattern naturally when sorting cards in our hands. In this lesson, using TypeScript / 阅读全文
posted @ 2018-08-13 20:29 Zhentiw 阅读(232) 评论(0) 推荐(0)
摘要:A palindrome is a string that reads the same forward and backward, for example, radar, toot, and madam. In this lesson we discuss how to approach the 阅读全文
posted @ 2018-08-10 18:42 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要:The anagram test is commonly used to demonstrate how an naive implementation can perform significant order of magnitudes slower than an efficient one. 阅读全文
posted @ 2018-08-10 18:26 Zhentiw 阅读(236) 评论(0) 推荐(0)
摘要:Prior odd: The idea is to take the odds for something happening (against it not happening), which we´ll write as prior odds. For example: The chances 阅读全文
posted @ 2018-07-11 20:04 Zhentiw 阅读(4211) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 下一页