C/C++
dk_swjtu
这个作者很懒,什么都没留下…
展开
-
求0x5f3759df的数学原理
Quake-III Arena (雷神之锤3)是90年代的经典游戏之一。该系列的游戏不但画面和内容不错,而且即使计算机配置低,也能极其流畅地运行。这要归功于它3D引擎的开发者约翰-卡马克(John Carmack)。事实上早在90年代初DOS时代,只要能在PC上搞个小动画都能让人惊叹一番的时候,John Carmack就推出了石破天惊的Castle Wolfstein, 然后再接再励,doom,转载 2015-02-08 12:10:20 · 1117 阅读 · 0 评论 -
Win32串口编程(C++)
原地址:http://www.vckbase.com/index.php/Old/index/id/1734Win32串口编程作者:韩耀旭下载源代码 在工业控制中,工控机(一般都基于Windows平台)经常需要与智能仪表通过串口进行通信。串口通信方便易行,应用广泛。一般情况下,工控机和各智能仪表通过RS485总线进行通信。RS485的通信方式是半双工的,只转载 2015-04-22 18:56:20 · 596 阅读 · 0 评论 -
2015华为软件精英挑战赛
先挖坑,回头填。原创 2015-06-06 18:13:46 · 1129 阅读 · 0 评论 -
Invert Binary Tree
题目很简单,leetcode加这道题是因为Homebrew作者面试谷歌却没写出来被拒了,然后还在推上吐槽。原创 2015-07-26 11:57:25 · 423 阅读 · 0 评论 -
Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is原创 2015-07-26 20:31:52 · 957 阅读 · 0 评论 -
Rectangle Area
Find the total area covered by two rectilinear rectangles in a2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that the total a原创 2015-07-26 17:15:17 · 487 阅读 · 0 评论 -
Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value原创 2015-07-17 18:24:45 · 393 阅读 · 0 评论 -
Power of Two
Given an integer, write a function to determine if it is a power of two.给一个整数,判断是否是2的幂。2的幂的2进制数只有最高位为1,减1之后全为1。所以2的幂n&(n-1)==0.代码如下:class Solution {public: bool isPowerOfTwo(int n) {原创 2015-07-21 22:57:07 · 310 阅读 · 0 评论 -
Palindrome Linked List
Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?判断一个链表是否为回文序列。遍历一次存入vector,便利第二次判断是否回文;但是这样的空间复杂副就是O(n)。代码如下:/** * Definiti原创 2015-07-21 21:48:00 · 312 阅读 · 0 评论