随笔分类 - C/C++
摘要:从3月2号开始一直在做实训的文件加密系统,一转眼系统的基本功能已经实现,全组都在集中精力搞文件驱动加密。在完成基本功能时,也遇到了很多问题,现把这段时间积累的笔记整理存档下。#### 检查指定目录是否存在函数原型: BOOL MakeSureDirectoryPathExists( PCSTR Di...
阅读全文
摘要:这道题来源于IBM power8算法挑战赛第三期,以下是给出的比赛规则:### 比赛规则* 由CSDN提供30万篇文章浏览记录(总计1000万次),用户需要将曝光次数最多的T0P100文章输出。* 参赛者可以使用任意基于Linux平台的开发语言完成挑战。* 参赛者提交的文件 第一列是id,第二列是出...
阅读全文
摘要:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb...
阅读全文
摘要:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
阅读全文
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
阅读全文
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?思路:...
阅读全文
摘要:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
阅读全文
摘要:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re...
阅读全文
摘要:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
阅读全文
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:增加一个头指...
阅读全文
摘要:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,...
阅读全文
摘要:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space? 1 /** 2 * Definition for singly-linked l...
阅读全文
摘要:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
阅读全文
摘要:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 罗马数字有如下符号:罗马字符: I V X L C D M对应数字...
阅读全文
摘要:1. 求幂#include //头文件 pow(a,b); //a^b2. bool#include //C中使用bool型需要加入头文件3. 字符串操作相关#include //头文件 char a[20],b[20]; strcpy(a,b); //把字符串b拷贝到a中 length=s...
阅读全文
摘要:八月初心血来潮,花了一天时间写了一个控制台版的2048。代码很烂,玩到后面会有延迟现象。先做下记录,以后有时间把移动和合并的代码再优化下。 代码如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using n...
阅读全文

浙公网安备 33010602011771号