- 博客(13)
- 收藏
- 关注
原创 AttributeError: module ‘tensorflow‘ has no attribute ‘xxx‘
使用TensorFlow模块时的一个bug
2022-10-24 23:37:12 162 1
原创 Minimum Spanning Tree
DescriptionLet G=(V,E) be an undirected, connected, weighted graph who is represented as an adjacency matrix. Find the minimum spanning tree of G. A minimum spanning tree is a least-cost subset of the edges of a graph that connects all the nodes.Input
2021-11-08 23:37:25 132
原创 Longest Common Subsequence
DescriptionImplement the LCS algorithm introduced in the class. You are required to output all possible LCS. The output set of LCS should in lexicographical order. Same LCS only need to output once.ExamplesInput:springtimeprintingOutput:prin
2021-11-08 23:28:57 75
原创 KD Tree
Problem DescriptionImplement a k-d Tree(in this problem k=2) and support the following operations:insert: Insert a new node with key into the k-d tree. search: Search the node with the given key. remove: Remove the node with the given key. findMin:
2021-11-03 17:22:06 123
原创 Trie Tree
Problem DescriptionImplement a Trie(prefix tree) and support the following operations:insert: insert a string into the Trie. search: return true if the queried string has been inserted into the Trie. startsWith: return true if there is any string in
2021-11-03 17:18:27 85
原创 Find the k-th largest element in an array
Input FormatThe program takes as input two lines.The first line is an unsorted array of integers in the range of [0,255].The second line is an integer k that 1≤k≤arraylength.Output FormatThe k-th largest element of the given array.NoteDO NOT.
2021-10-25 16:42:47 116
原创 Cuckoo Hashing
We will implement Cuckoo Hashing here, which is a simple hash table with worst-case O(1) lookups and deletions.Cuckoo Hashing maintains two tables, each of which has m elements. Given an array X⊂N+, each element x∈X will either be at position h1(x) in t
2021-10-25 16:32:13 169
原创 Newton Interpolation
The main function takes as input two sequences of numbers and one single number. The first sequence represents [x1,x2,…,xi] of some points, and the second sequence represents [y1,y2,…,yi]. You need to find the Newton interpolating polynomial to pass
2021-10-23 23:06:49 259
原创 Lagrange Interpolation
The main function takes as input two sequences of numbers and one single number. The first sequence represents [x1,x2,…,xi] of some points, and the second sequence represents [y1,y2,…,yi]. You need to find the Lagrange interpolating polynomial to pas
2021-10-23 23:04:17 211
原创 H-Index
Given an array of integers citations where citations[i] is the number of citations a researcher received for their i-th paper. Please compute the researcher's h-index.According to the definition of h-index on Wikipedia: A scientist has an index h if h of
2021-10-23 22:47:33 291
原创 Newton‘s Method for Solving a Polynomial Equation
Problem DescriptionUse Newton's method to solve a polynomial equation. The equation can be represented asThe input contains two lines. The first line contains an integer n. The second line contains n+1 floating point numbers a0,...,an.ExamplesW..
2021-10-23 22:40:36 134
原创 Gaussian Elimination for solving a linear system
Problem DescriptionUse Gaussian Elimination to solve a linear system Ax = b. The input is in the form of the augmented matrix [A b]. A system of linear equations can have no solution, a unique solution or infinitely many solutions. The output should be a
2021-10-23 22:08:06 229
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人