Tất cả câu hỏi
Ngân hàng câu hỏi trắc nghiệm có giải thích chi tiết.
list (i.e. p.info=29):(head) 17 11 6 4 3 29 8 2 (tail) What does the list look like after the following java code snippet is run?
int x = 5;
Node p1, p2;
p1 = new Node(x);
p2 = p.next;
p.next = p1; p1.prev = p;
p1.next = p2; p2.prev = p1;deletepeekpopremovewhile(S is not empty){ch = top element of the stack S if ch is isolated then remove it from the stack and put it to E
elseselect the first vertex Y (by alphabet order), which is adjacent to ch,push Y to S and remove the edge (ch,Y) from the graph
}the last array E obtained is an Euler cycle of the graph Suppose a multigraph G is given below (view picture). Which of the followings is the Euler cycle from the vertex A, created by above algorithm?
int binarySearch(int [] a, int x, int low, int high)
{ int t, k;
if(low > high) return( -1);
k = (low + high) / 2;
if(a[k] == x) return(k);
if(x<a[k]) return(binarySearch(a,x,low,k-1);
else return(binarySearch(a,x,k+1,high);
}Suppose the array a is given by the statement:
int [] a = {2,4,6,8,10,12,14, 16};For the call binarySearch(a,7,2, 5), how many calls to this will be made, including the original call?
Hash function h(x) is a function which transforms a particular key x, be it a string, number, record, or the
like, into non-negative integer.Hash function h(x) is a function which transforms a particular key x, be it a string, number, record, or the
like, into an index i = h(x) in the table T, where T[i] is used for storing an item having key x or its address.Hash function h(x) is a function which transforms a particular key x (string, or number) into an index i =
h(x) in the table T, where T[i] is used for storing an item having key x or its address.Hash function h(x) is a function which transforms a particular key x, be it a string, number, record, or the
like, into a positive integer. f(n) = 2;
2. if n >1 then
f(n) = f(n-1) + 2f(n-2)What is the value of f(4) ?
A recursive method is a method that invokes itself directly or indirectly. For a recursive method to terminate
there must be one or more base cases.