
HackerRank
文章平均质量分 65
诗意de栖居
这个作者很懒,什么都没留下…
展开
-
HackerRank Largest Rectangle
题目链接Problem StatementThere are N buildings in a certain two-dimensional landscape. Each building has a height given byhi,i∈[1,N]. If you join K adjacent buildings, they will form a原创 2015-12-18 21:56:20 · 391 阅读 · 0 评论 -
HackerRank Truck Tour
题目链接#includeint FindMin(int *queue, int n){ long long sum = 0; int i = 0, j = 0; for (; i < n; i++) { sum += queue[i]; if (sum < 0) { sum = 0; j = i + 1; } } return j;}int原创 2015-12-19 10:42:34 · 594 阅读 · 0 评论 -
HackerRank Self Balancing Tree(AVL树)
题目链接/* Node is defined as :typedef struct node{ int val; struct node* left; struct node* right; int ht;} node; */int Height(node *T){ if (!T) return -1; //In this qu原创 2015-12-19 22:21:07 · 508 阅读 · 0 评论 -
HackerRank Huffman Decoding(Huffman解码)
题目链接/* The structure of the node istypedef struct node{ int freq; char data; node * left; node * right; }node;*/void decode_huff(node * root,string s){ char str[50原创 2015-12-19 10:39:45 · 527 阅读 · 0 评论 -
HackerRank Reverse a linked list(逆置链表)
题目链接/* Reverse a linked list and return pointer to the head The input list will have at least one element Node is defined as struct Node { int data; struct Node *next; }*/原创 2015-12-19 10:37:02 · 678 阅读 · 0 评论 -
HackerRank Find Median(中位数)
题目链接Problem StatementThe median of a finite list of numbers can be found by arranging all the integers from lowest to highest value and picking the middle one. For example, the median of{3原创 2015-12-18 22:52:43 · 437 阅读 · 0 评论