http://blog.csdn.net/hackbuteer1/article/details/12190807
A、Threads share the same address space of the parent process;Processes share the same address space of the parent process.
C、Multiple threads mar cause deadlock,while multiple processes won't cause deadlock.
E、None of the above.
A、TCP provides a way for applications to send encapsulated IP datagrams and send them without having to establish a connection.
B、TCP supports multicasting.
3、Initialize integer i as 0, what's the value of i after the following operation?(5 Points)
i += i > 0 ? i++ : i --;
D、external difinitions and references for linking
int f(int x){if(x <= 2)return 1;return f(x - 2) + f(x - 4) + 1;}
B、18
C、20
D、24
{
ID(7 digit numeric)
Family Name(string)
Account Balance(currency)
}
If you have 500,000 Chinese customers records represented by instances of this object type , what set of data structures is best to get fast retrieval of customers (1) get IDs from Name and (2) get Name from ID?
A、(1) Tree with Hash(100 bucket) at leaves(2) Tree with linked list at leaves.
D、(1) Sort linked list(2) Array.
8、Let's assume one type of cancer may be mis-diagnosed in the examination. 5 out of 100 people with this cancer will be diagnosed as not having it , and 1 out of 100 people without this cancer will be diagnosed as having it. We know the chance of getting this cancer is around 0.1%. One person was examined and diagnosed of having this cancer, which of the following value if the closest to the chance of is really having it?(5 Points)
A、90%
B、50%
C、30%
9、In which case(s) would you use an outer join?(5 Points)
A、The table being joined have NOT NULL columns.B、The table being joined have only matched data.
10、As shown in the graph , start from node B , traverse the nodes on a Depth-First Search(DFS) algorithm , which is(are) the possible traversa sequence(s)? Select all that apply.(5 Points)
C、BCAFDE
11、The best time complexity of quick sort algorithm is:(5 Points)
A、O(lgn)
B、O(n)
D、O(n*n)
12、Which of the following method(s) CANNOT be used for Text-encryption:(5 Points)
B、RSA
C、RC4
D、DES
A、5
B、30
C、45
E、55
14、Which is(are) valid function pointer declaration(s) below ? Select all that apply.(5 Points)
A、void* f(int);
D、void (*(*f)(int))();
B、Use special instructions(e.g. vector instructions) to replace compiler generated assembly code.
C、Change an algorithm from recursive implementation to iterative implementation.
16、Which regular expression(s) matches the sentence "www.microsoft.com" ? (5 Points)
B、[w]{0,3}.[a-z]*.[a-z]+
C、.[c-w.]{3,10}[.][c-w.][.][a]|.+
D、[w][w][w][microsoft]+[com]+
E、\w*
17、In the image below , if the function is designed to multiply two positive numbers which line number in the image contains the biggest functional bug(assume no overflow)? (5 Points)
B、Line 2
C、Line 3
E、Line 5
18、Which of the following can be referred to as attack method(s)? Select all that apply.(5 Points)
C、Drive-by downloading
19、A table CANNOT have one or more of the following index configurations.(5 Points)
A、No indexes
B、A clustered index
C、clustered index and many non-clustered indexes
20、Which of the following is(are) true about providing security to database servers ? Select all that apply.(5 Points)
C、Do not use blank password for SA account
21、Given a singly linked list L: (L0 , L1 , L2...Ln-1 , Ln). Write a program to reorder it so that it becomes(L0 , Ln , L1 , Ln-1 , L2 , Ln-2...).
struct Node{int val_;Node* next;};
1、Space Complexity should be O(1)
2、Only the ".next" field of a node is modifiable.
代碼:
//轉載請標明出處,原文地址:http://blog.csdn.net/hackbuteer1/article/details/12190807struct Node{ int val_; Node* next; };Node* reverse_list(Node* phead) //鏈表反轉{Node *temp ,*curr , *pre , *reverse_head;pre = NULL;curr = phead;while(curr->next){temp = curr->next;curr->next = pre;pre = curr;curr = temp;}curr->next = pre;reverse_head = curr;return reverse_head;}Node* Merge(Node* slow , Node* fast){if(fast == NULL)return slow;if(slow == NULL)return fast;Node *head , *result;result = NULL;int i = 0;while(slow && fast){if(0 == i){if(NULL == result){head = result = slow;slow = slow->next;}else{result->next = slow;slow = slow->next;result = result->next;}}else{if(NULL == result){head = result = fast;fast = fast->next;}else{result->next = fast;fast = fast->next;result = result->next;}}i ^= 1;}//whileif(slow){result->next = slow;}if(fast){result->next = fast;}return head;}Node* reorder_list(Node* phead){Node *r_head , *slow , *fast;r_head = slow = fast = phead;while(fast->next != NULL && fast->next->next != NULL){slow = slow->next;fast = fast->next->next;}if(slow->next == NULL)return r_head;fast = slow->next;slow->next = NULL;slow = phead;fast = reverse_list(fast); //鏈表的後半部分反轉r_head = Merge(slow , fast); //鏈表歸併return r_head;}
轉載請標明出處處,原文地址:http://blog.csdn.net/hackbuteer1/article/details/12190807