写代码,有两类追求,一种是追求实用(Coder),一种是追求代码艺术(Artist) 我是那种追实用追腻了,偶然追一下艺术(就是偶然和艺术有一腿)的那种Coder 很多人,已经习惯了for(i=0; i<n; i++)这种单调的循环,虽然这的确的使用率最高, 但在特殊场合,特殊的循环写法,不但能提升循环的效率,还能使代码更精巧 1. 质数判断 对于这个,很多人可能会直接这样写: int isPrime(int n) //函数返回1表示是质数,返回0表示不是质数 { int i; for (i =
第5章 数据寻址 C54x DSP提供7种基本寻址方式. ■ Immediate addressing uses the instruction to encode a fixed value. ■ Absolute addressing uses the instruction to encode a fixed address. ■ Accumulator addressing uses an accumulator to access a location in pr
(1)Linked List Cycle Total Accepted: 13297 Total Submissions: 38411 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? (url:http://oj.leetcode.com/problems/linked-list-cycle/) 这一题是给定一个link