- 博客(13)
- 收藏
- 关注
原创 408(持续更新)
数据结构时间复杂度线性表:具有随即存储特性,查找时间复杂度为O(1)单链表:尾插法增加尾指针,申请空间,插入栈及其应用1.根据限定条件判断合法性:根据输入序列判断,是否有可能的输出序列2.最小容量:题目:设栈S和队列Q,其状态为空,元素a1,a2,a3,a4,a5,a6依次入栈,出栈的元素则进入队列Q,若6个元素出列顺序是a2 ,a3 ,a4 ,a6, a5, a1,则栈的容量至少是()。33.表达式求值***4.中缀表达式转换为后缀表达式过程2*(9
2021-03-20 16:23:45
491
转载 1058: 重排奇偶数组 ACM
#include <iostream>void Swap(int &a, int &b){ int temp = a; a = b; b = temp;}void ChangeArray(int arr[], int len){ int begin = 0; int end = len - 1; while (begin < e...
2018-06-07 17:44:00
360
转载 leetcode 从排序数组中删除重复项
class Solution {public: /** * @param A: a list of integers * @return : return an integer */ int removeDuplicates(vector<int> &nums) { // write your code here...
2018-05-10 11:58:28
191
原创 线性表的概念与实现--顺序存储( 数组 )C语言
#include<stdio.h>#include<stdlib.h>struct list* Makelist();void Addlist(list* L,int data,int insert);struct list{ int data[10]; int last;};int main(){ list* L; int data; int ...
2018-05-10 10:22:40
707
原创 (入门)Lintcode 466. 链表节点计数
/** * Definition of singly-linked-list: * class ListNode { * public: * int val; * ListNode *next; * ListNode(int val) { * this->val = val; * this->next = NULL;...
2018-04-22 10:41:58
424
原创 01-复杂度1 最大子列和问题
#include<iostream>using namespace std;int main(){ int max; int temp=0; int n; int a[n]; int i; int j; int k; cin>>n; for (i=0; i<n; i++) { cin>>a[i]; } for (i=...
2018-04-19 09:19:23
291
转载 lintcode.452.删除链表中元素
题目描述删除链表中等于给定值val的所有节点。测试样例给出链表 1->2->3->3->4->5->3, 和 val = 3, 你需要返回删除3之后的链表:1->2->4->5。1解题思路这道题虽然被归为入门题,但是坑很多。上次去深信服面试就问道了这道题。要注意两点:1、要删除的元素可能不止一个。2、要删除的可能是头节点。明白了这个,就好做了。...
2018-04-15 20:11:27
259
原创 lintcode145大小写变换
class Solution {public: /** * @param character: a character * @return: a character */ char lowercaseToUppercase(char character) { // write your code here char c; ...
2018-04-15 19:31:45
1120
1
原创 (单科成绩录入单科成绩排名,链表,文件)C语言学生管理系统
#include<stdio.h>#include<stdlib.h>#include<string.h>struct Student { char m_strName[100]; char m_strSex[10]; char m_strNumber[100]; double m_fEnglish; double m_fMath; double m_fComp...
2018-03-16 10:17:39
3390
原创 C语言学生管理系统(链表以及文件操作)
#include<stdio.h>#include<stdlib.h>#include<string.h>struct Student { char m_strName[100]; char m_strSex[10]; char m_strNumber[100]; double m_fEnglish; double m_fMath; double m_fComp...
2018-03-14 08:36:09
2607
转载 L1-010. 比较大小///转
#includeint main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); a>b?a>c?b>c?printf("%d->%d->%d",c,b,a):printf("%d->%d->%d",b,c,a):printf("%d->%d->%d",b,a,c):b>c?c>a?printf("%d->%d->%d",a
2018-02-03 09:14:11
242
转载 打印沙漏
#include #define ABS(X) ((X) >= 0 ? (X) : -(X))int main(){ char c; int N, M; scanf("%d %c", &N, &c); for(M = 1; 2 * M * M - 1 /* draw the pyramid */ for(in
2018-01-22 22:34:54
207
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人