锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
榪欎釜鏂板勾錛屽湪鍝ュ摜姣忔棩鏃╀笂鐨勯棶鍊欙紝鍜岄┈鏅皵灝忓鐨勪埂鏉戠敓媧諱腑錛屾貳娣$殑搴﹁繃銆傚拰鍝ュ摜鍦ㄤ竴璧風殑鏃ュ瓙錛屽畬鍏ㄥ彲浠ヤ笉闇瑕佺綉緇滅殑瀛樺湪錛屽彧鍜屽鏂圭浉浼達紝閮借兘鏈夌潃鏃犳瘮綺懼僵鍜屼赴瀵岀殑鐢熸椿銆?br>
緗戠粶鑱婂ぉ鐨勫伐鍏鳳紝灝辮瀹冩參鎱㈡貳鍑烘垜鐨勭敓媧誨惂錛屼篃鏈皾涓嶆槸涓涓柊鐨勫紑濮嬨?br>
鏈榪戝湪鐪婮ava鐗堢殑鏁版嵁緇撴瀯鍜屼竴浜汚ndroid鐨勭煡璇嗭紝鍦ㄨ繖閲岋紝閲嶆柊寮杈熶竴涓皬澶╁湴鍚с侳or both of us, only love that matters……
]]>
2. C++緙栬瘧鍣ㄥ皢緇撴瀯鍚嶈漿鍙樹負涓涓柊鐨勭被鍨嬪悕錛堝int,char,float鍜宒ouble鏄被鍨嬪悕涓鏍鳳級
3. 鍦ㄤ笅闈㈢殑C鐗堟湰鐨剆truct鐨勫嚱鏁頒腑錛岀‖鎬т紶閫掔粨鏋勭殑鍦板潃浣滀負榪欎簺鍑芥暟鐨勭涓涓弬鏁般備緥濡傦細
typedef struct CstashTag{
int size; //size of each space
//.........
} Cstash;
void initialize(CStash *s, int size);
鑰孋++涓垯涓嶆槸錛岃繖涓榪囩▼鏄敱緙栬瘧鍣ㄦ潵瀹屾垚銆?BR> struct Stash {
int size; //size of each space
//.........
void initialize(int size);
};
]]>
銆銆3錛庤闂氦鎹㈡満鍜岃礬鐢卞櫒鍚勮嚜鐨勫疄鐜板師鐞嗘槸浠涔堬紵鍒嗗埆鍦ㄥ摢涓眰嬈′笂闈㈠疄鐜扮殑錛?BR>銆銆4錛庤闂瓹++鐨勭被鍜孋閲岄潰鐨剆truct鏈変粈涔堝尯鍒紵
銆銆5錛庤璁蹭竴璁叉瀽鏋勫嚱鏁板拰铏氬嚱鏁扮殑鐢ㄦ硶鍜屼綔鐢ㄣ?BR>銆銆6錛庡叏灞鍙橀噺鍜屽眬閮ㄥ彉閲忔湁浠涔堝尯鍒紵鏄庝箞瀹炵幇鐨勶紵鎿嶄綔緋葷粺鍜岀紪璇戝櫒鏄庝箞鐭ラ亾鐨勶紵
銆銆7錛?086鏄灝戜綅鐨勭郴緇燂紵鍦ㄦ暟鎹葷嚎涓婃槸鎬庝箞瀹炵幇鐨勶紵
鑱旀兂絎旇瘯棰?BR> 1錛庤璁″嚱鏁?int atoi(char *s)銆?BR>銆銆2錛巌nt i=(j=4,k=8,l=16,m=32); printf(鈥?d鈥? i); 杈撳嚭鏄灝戯紵
銆銆3錛庤В閲婂眬閮ㄥ彉閲忋佸叏灞鍙橀噺鍜岄潤鎬佸彉閲忕殑鍚箟銆?BR>銆銆4錛庤В閲婂爢鍜屾爤鐨勫尯鍒?BR>銆銆5錛庤榪板惈鍙傛暟鐨勫畯涓庡嚱鏁扮殑浼樼己鐐?/FONT>
鏅ぉC++絎旇瘯棰?BR> 1錛庡疄鐜板弻鍚戦摼琛ㄥ垹闄や竴涓妭鐐筆錛屽湪鑺傜偣P鍚庢彃鍏ヤ竴涓妭鐐癸紝鍐欏嚭榪欎袱涓嚱鏁般?BR>銆銆2錛庡啓涓涓嚱鏁幫紝灝嗗叾涓殑\t閮借漿鎹㈡垚4涓┖鏍箋?BR>銆銆3錛嶹indows紼嬪簭鐨勫叆鍙f槸鍝噷錛熷啓鍑篧indows娑堟伅鏈哄埗鐨勬祦紼嬨?BR>銆銆4錛庡浣曞畾涔夊拰瀹炵幇涓涓被鐨勬垚鍛樺嚱鏁頒負鍥炶皟鍑芥暟錛?BR>銆銆5錛嶤++閲岄潰鏄笉鏄墍鏈夌殑鍔ㄤ綔閮芥槸main()寮曡搗鐨勶紵濡傛灉涓嶆槸錛岃涓句緥銆?BR>銆銆6錛嶤++閲岄潰濡備綍澹版槑const void f(void)鍑芥暟涓篊紼嬪簭涓殑搴撳嚱鏁幫紵
銆銆7錛庝笅鍒楀摢涓や釜鏄瓑鍚岀殑
銆銆int b;
銆銆A const int* a = &b;
銆銆B const* int a = &b;
銆銆C const int* const a = &b;
銆銆D int const* const a = &b;
銆銆8錛庡唴鑱斿嚱鏁板湪緙栬瘧鏃舵槸鍚﹀仛鍙傛暟綾誨瀷媯鏌ワ紵
銆銆void g(base & b){
銆銆 b.play;
銆銆}
銆銆void main(){
銆銆 son s;
銆銆 g(s);
銆銆 return;
銆銆}
1. How do you code an infinite loop in C?
銆銆2. Volatile:
銆銆錛?錛塛hat does the keyword volatile mean? Give an example
銆銆錛?錛塁an a parameter be both const and volatile? Give an example
銆銆錛?錛塁an a pointer be volatile? Give an example
銆銆3. What are the values of a, b, and c after the following instructions:
銆銆int a=5, b=7, c;
銆銆c = a+++b;
銆銆4. What do the following declarations mean?
銆銆錛?錛塩onst int a;
銆銆錛?錛塱nt const a;
銆銆錛?錛塩onst int *a;
銆銆錛?錛塱nt * const a;
銆銆錛?錛塱nt const * a const;
銆銆5. Which of the following statements describe the use of the keyword static?
銆銆錛?錛塛ithin the body of a function: A static variable maintains its value between function revocations
銆銆錛?錛塛ithin a module: A static variable is accessible by all functions within that module
銆銆錛?錛塛ithin a module: A static function can only be called by other functions within that module
銆銆6. Embedded systems always require the user to manipulate bits in registers or variables. Given an integer variable a, write two code fragments.
銆銆The first should set bit 5 of a. The second shnuld clear bit 5 of a. In both cases, the remaining bits should be unmodified.
銆銆7. What does the following function return?
銆銆char foo(void)
銆銆{
銆銆 unsigned int a = 6;
銆銆 iht b = -20;
銆銆 char c;
銆銆 (a+b > 6) ? (c=1): (c=0);
銆銆 return c;
銆銆}
銆銆8. What will be the output of the following C code?
銆銆main()
銆銆{
銆銆 int k, num= 30;
銆銆 k =(num > 5 ? (num <=10 ? 100:200): 500);
銆銆 printf(鈥?d鈥? k);
銆銆}
銆銆9. What will the following C code do?
銆銆int *ptr;
銆銆ptr =(int *)Ox67a9;
銆銆*ptr = Oxaa55;
銆銆10. What will be the output of the follow C code?
銆銆#define product(x) (x*x)
銆銆main()
銆銆{
銆銆 int i = 3, j, k;
銆銆 j = product(i++);
銆銆 k = product(++i);
銆銆 printf(鈥?d %d鈥?j,k);
銆銆}
銆銆11. Simplify the following Boolean expression
銆銆!((i ==12) || (j > 15))
銆銆12. How many flip-flop circuits are needed to divide by 16?
銆銆13. Provides 3 properties that make an OS, a RTOS?
銆銆14. What is pre-emption?
銆銆15. Assume the BC register value is 8538H, and the DE register value is 62A5H.Find the value of register BC after the following assembly operations:
銆銆MOV A,C
銆銆SUB E
銆銆MOV C,A
銆銆MOV A,B
銆銆SBB D
銆銆MOV B,A
銆銆16. In the Assembly code shown below
銆銆LOOP: MVI C,78H
銆銆 DCR C
銆銆 JNZ LOOP
銆銆 HLT
銆銆How many times is the DCR C Operation executed?
銆銆17. Describe the most efficient way (in term of execution time and code size) to divide a number by 4 in assembly language
銆銆18. what value is stored in m in the following assembly language code fragment if n=7?
銆銆 LDAA #n
銆 銆LABEL1: CMPA #5
銆銆 BHI L3
銆銆 BEQ L2
銆銆 DECA
銆銆 BRA L1
銆銆LABEL2: CLRA
銆銆LABEL3: STAA #m
銆銆19. What is the state of a process if a resource is not available?
銆銆#define a 365*24*60*60
銆銆20. Using the #define statement, how would you declare a manifest constant that returns the number of seconds in a year? Disregard leap years in your answer.
銆銆21. Interrupts are an important part of embedded systems. Consequently, many compiler vendors offer an extension to standard C to support interrupts. Typically, the keyword is __interrupt. The following routine (ISR). Point out problems in the code.
銆銆__interrupt double compute_area (double radius)
銆銆{
銆銆 double area = PI * radius * radius;
銆銆 printf(鈥淺nArea = %f鈥? area);
銆銆 return area;
銆銆}
緇村皵VERITAS杞歡絎旇瘯棰?/FONT>
銆銆1. A class B network on the internet has a subnet mask of 255.255.240.0, what is the maximum number of hosts per subnet .
銆銆a. 240 b. 255 c. 4094 d. 65534
銆銆2. What is the difference: between o(log n) and o(log n^2), where both logarithems have base 2 .
銆銆a. o(log n^2) is bigger b. o(log n) is bigger
銆銆c. no difference
銆銆3. For a class what would happen if we call a class鈥檚 constructor from with the same class鈥檚 constructor .
銆銆a. compilation error b. linking error
銆銆c. stack overflow d. none of the above
銆銆4. 鈥渘ew鈥?in c++ is a: .
銆銆a. library function like malloc in c
銆銆b. key word c. operator
銆銆d. none of the above
銆銆5. Which of the following information is not contained in an inode .
銆銆a. file owner b. file size
銆銆c. file name d. disk address
銆銆6. What鈥檚 the number of comparisons in the worst case to merge two sorted lists containing n elements each .
銆銆a. 2n b.2n-1 c.2n+1 d.2n-2
銆銆7. Time complexity of n algorithm T(n), where n is the input size ,is T(n)=T(n-1)+1/n if n>1 otherwise 1 the order of this algorithm is .
銆銆a. log (n) b. n c. n^2 d. n^n
銆銆8. The number of 1鈥檚 in the binary representation of 3*4096+ 15*256+5*16+3 are .
銆銆a. 8 b. 9 c. 10 d. 12
鎵櫤錛堢鎶錛夌瑪璇曢鐩?/SPAN>
銆銆1. Queue is a useful structure
銆銆* What is a queue?
銆銆* Write 5 operations or functions, without details, that can be done on a queue.
銆銆2. Insert a sequence fo keys(24,49,13,20,59,23,90,35) into a data structure, which has no keys initially. Depict the data structure after these insertions, if it is:
銆銆* a heap tree
銆銆* an AVL tree
銆銆3. * What is a synchronous I/O bus?
銆銆* What is an asnchronous I/O bus?
銆銆* Compare the advantages and disadvantages of synchronous and a synchronous I/O bus.
銆銆4. Explain the following terminology:
銆銆* Baud rate
銆銆* Handshaking
銆銆* Memory mapped I/O
銆銆5. Explain the key issues in supporting a real-time operation system for embedded system.
銆銆6. Explain the mapping of visual addresses to real addresses under paging by
銆銆* direct mapping
銆銆* associative mapping
銆銆* combined direct/associated mapping
銆銆7. Please explain what is 鈥渨rite-back鈥?and 鈥渨rite-through鈥? and discuss the advantage and disadvantage about these two methods.
銆銆8. Explain the concept and benefit of threads
銆銆9. What is hardware interrupt? What is software interrupt? What is exception? Please tell me all you know about interrupt.
銆銆10. Write a recursive function that tests wether a string is a palindrome. A palindrome is s string such as 鈥渁bcba鈥?or 鈥渙tto鈥?that reads the same in both directions.If you can write this function recursively,you can write an iterative version of this function instead.
銆銆11錛庝粈涔堟槸榪涚▼錛圥rocess錛夊拰綰跨▼錛圱hread錛夛紵鏈変綍鍖哄埆錛?BR>銆銆12錛嶮FC鍜孲DK鏈変綍鍖哄埆錛?BR>銆銆13錛嶪RP鏄粈涔堬紵鏈変綍浣滅敤錛?BR>銆銆14錛嶹indows 2000鎿嶄綔緋葷粺涓嬬敤鎴鋒ā寮忓拰鍐呮牳妯″紡涓嬬紪紼嬫湁浣曞尯鍒紵
銆銆15錛庨┍鍔ㄧ▼搴忕殑BUFFER鑳絪wap鍒扮鐩樹笂鍘誨悧錛熶負浠涔堬紵
銆銆16錛庤瘯緙栧啓3涓嚱鏁板疄鐜?BR>銆銆錛?錛夊緩绔嬩竴涓弻鍚戦摼琛?BR>銆銆錛?錛夋彃鍏ヤ竴涓妭鐐?BR>銆銆錛?錛夊垹闄や竴涓妭鐐?BR>銆銆17錛庣畝榪癏ardware interrupt鍜宻oftware涓柇鐨勫尯鍒紝綆榪板叾搴旂敤銆?BR>銆銆18錛庤瘯緙栧啓涓涓嚱鏁幫紝璁$畻涓涓瓧絎︿覆涓瑼鐨勪釜鏁般?BR>銆銆19錛庣敾鍑哄叾鐩稿簲嫻佺▼鍥懼茍緙栧啓涓涓嚱鏁板疄鐜頒竴涓暣鏁板埌浜岃繘鍒舵暟鐨勮漿鎹紝濡傝緭鍏?錛岃緭鍑?10銆?BR>銆銆20錛?BR>銆銆錛?錛夌紪鍐欎竴涓掑綊鍑芥暟錛屽垹闄や竴涓洰褰曘?BR>銆銆錛?錛夌紪鍐欎竴涓潪閫掑綊鍑芥暟錛屽垹闄や竴涓洰褰曘?BR>銆銆騫舵瘮杈冨叾鎬ц兘銆?/FONT>
騫夸笢鍖楃數闈㈣瘯棰樼洰
銆銆鑻辨枃絎旇瘯棰?BR>銆銆1. Tranlation (Mandatory)
銆銆CDMA venders have worked hard to give CDMA roaming capabilities via the development of RUIM-essentially, a SIM card for CDMA handsets currently being deployed in China for new CDMA operator China Unicom. Korean cellco KTF demonstrated earlier this year the ability to roam between GSM and CDMA using such cards.However,only the card containing the user鈥檚 service data can roam-not the CDMA handset or the user鈥檚 number (except via call forwarding).
銆銆2. Programming (Mandatory)
銆銆Linked list
銆銆a. Implement a linked list for integers,which supports the insertafter (insert a node after a specified node) and removeafter (remove the node after a specified node) methods;
銆銆b. Implement a method to sort the linked list to descending order.
銆銆3. Debugging (Mandatory)
銆銆a. For each of the following recursive methods,enter Y in the answer box if themethod terminaters (assume i=5), Otherwise enter N.
銆銆static int f(int i){
銆銆 return f(i-1)*f(i-1);
銆銆 }
銆銆Ansewr:
銆銆static int f(int i){
銆銆 if(i==0){return 1;}
銆銆 else {return f(i-1)*f(i-1);}
銆銆 }
銆銆Ansewr:
銆銆static int f(int i){
銆銆 if(i==0){return 1;}
銆銆 else {return f(i-1)*f(i-2);}
銆銆 }
銆銆Ansewr:
銆銆b. There are two errors in the following JAVA program:
銆銆static void g(int i){
銆銆 if(i==1){return;}
銆銆 if(i%2==0){g(i/2);return;}
銆銆 else {g(3*i);return;}
銆銆 }
銆銆please correct them to make sure we can get the printed-out result as below:
銆銆3 10 5 16 8 4 2 1
銆銆
銆銆涓枃絎旇瘯棰?BR>銆銆1錛庢眽璇戣嫳
銆銆鍖楃數緗戠粶鐨勫紑鍙戣呰鍒掍嬌鏉ヨ嚜浜庝笉鍚岀粍緇囩殑寮鍙戣咃紝鑳藉鍦ㄥ寳鐢電綉緇滅殑騫沖彴涓婂紑鍙戝渾婊$殑琛ュ厖涓氬姟銆傚寳鐢電綉緇滅鍚堝伐涓氭爣鍑嗙殑寮鏀炬帴鍙o紝涓鴻ˉ鍏呬笟鍔$殑寮灞曞紩鍏ヤ簡鏃犳暟鍟嗘満錛屽紑鍙戣呰鍒掍負涓嶅悓灞傞潰鐨勫紑鍙戣呮彁渚涗笉鍚岀瓑綰х殑璧勬牸錛岃祫鏍肩殑鍒掑垎榪樿冭檻鍒頒互涓嬪洜绱狅細琛ュ厖涓氬姟涓庡寳鐢電綉緇滃鉤鍙扮殑闆嗗悎紼嬪害錛屽紑鍙戣呭洟浣撲笌鍖楃數緗戠粶鐨勫悎浣滃叧緋伙紝絳夌瓑銆?BR>銆銆2錛庣紪紼?BR>銆銆灝嗘暣鏁拌漿鎹㈡垚瀛楃涓詫細void itoa(int,char);
銆銆渚嬪itoa(-123,s[])鍒檚=鈥?123鈥?