
C
文章平均质量分 60
Kelly Fu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Fizz Buzz(412)
412—Fizz BuzzWrite a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five outp...原创 2018-12-13 11:54:25 · 183 阅读 · 0 评论 -
Add Two Numbers(2)
2— Add Two NumbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two n...原创 2018-12-24 14:51:17 · 128 阅读 · 0 评论 -
线性表实现(链表)
链表结构typedef int ElemType;typedef int Bool;#define True 1#define False 0typedef enum{ success = 0, fail, range_error, fatal}Status;typedef struct Node{ ElemType data; struct Node...原创 2018-12-24 14:20:31 · 126 阅读 · 0 评论 -
Longest Substring with At Least K Repeating Characters(395)
395—Longest Substring with At Least K Repeating CharactersFind the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no l...原创 2018-12-18 17:09:49 · 200 阅读 · 0 评论 -
Fraction Addition and Subtraction(592)
592—Fraction Addition and SubtractionGiven a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result shoul...原创 2018-12-11 21:57:56 · 323 阅读 · 0 评论 -
Degree of an Array(697)
697—Degree of an ArrayGiven a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.Your task is to find the smallest...原创 2018-12-11 21:55:32 · 115 阅读 · 0 评论 -
队列实现(链表)
链式结构#include <stdio.h>#include <stdlib.h>typedef int ElemType;typedef enum {underflow, success, fatal} Status;typedef struct node{ ElemType ele; struct node * next;}Node,*Node...原创 2018-12-27 17:55:20 · 144 阅读 · 0 评论 -
队列实现(顺序结构2-循环队列)
循环队列问题解决如何解决浪费的问题、假溢出问题,循环队列来解决.循环队列来解决.循环队列空和满的判断解决:使用一个计数器count, 初始化为0, 入队列加一, 出队列减一 ,当count == QUEUE_SIZE, 则判断队列满利用一个flag标记, true代表入队列, false代表出队列, 初始化为false. 当head == tail, 如果flag为tr...原创 2018-12-27 16:15:35 · 240 阅读 · 0 评论 -
队列实现(顺序结构)
顺序结构结构#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#define QUEUE_SIZE 10typedef int ElemType;typedef enum {overflow,underflow,success,fatal}Status;typedef struct queue{ ElemType *ele; ...原创 2018-12-27 15:50:11 · 324 阅读 · 0 评论 -
线性表实现(顺序存储)
线性表结构typedef int ElemType;#define LIST_INIT_SIZE 100#define LIST_INCREAMENT 10//定义一个Bool类型typedef int Bool;#define TRUE 1#define FASLE 0// 操作线性表返回状态typedef enum{ success = 0, fail, ra...原创 2018-12-21 17:07:24 · 188 阅读 · 0 评论 -
Valid Triangle Number(511)
511—Valid Triangle NumberGiven an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths o...原创 2018-12-10 12:11:26 · 162 阅读 · 0 评论 -
栈实现(链式结构)
链式结构#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;#include &lt;stdbool.h&gt;typedef int ElemType;typedef enum {overflow, underflow, success, fatal} Status;typedef struct node{ ElemType ele...原创 2018-12-26 14:55:02 · 260 阅读 · 0 评论 -
Random Pick Index(398)
398—Random Pick IndexGiven an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.Note...原创 2018-12-13 17:05:48 · 174 阅读 · 0 评论 -
栈实现(顺序结构)
顺序结构#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;stdbool.h&amp;gt;#define STACK_SIZE 100typedef int ElemType;typedef enum { overflow, underflow, success, fatal}S原创 2018-12-26 12:23:14 · 268 阅读 · 0 评论