If V is a vector with n items and subroutine Exchange swaps its arguments, then the following code fragment sorts V in descending order. for( j = 0; j < n - 1; j++ ) for( k = 0; k < n - j - 1; k++ ) if( V[k] < V[k+1] ) Exchange( V[k], V[k+1] ); How many calls to Exchange are made if initially, V[i]=i, for i = 0, 1, 2, ..., n - 1 ? a. n-1 b. n c. n(n-1)/2 d. (n-1)(n-2) e. n(n-1)
Software Engineer Interview Questions
467,290 software engineer interview questions shared by candidates
Buddy bitmap clear bit and event handler
One of the questions was reverse a string and capitalize the front and end letter of the word .
A string for example: AAAAABBBCCCCDD has to be converted into A5B3C4D2.
1 1 2 1 1 3 3 1
- Languages: Different between Java and C++, garbage collector in java (how it work), static vs dynamic memory allocation - Data structures: Linked lists, queues, stacks, heap, trees - OOP: polymorphism, design patterns that I used before - Algorithms: Sorting algorithms I know and there complexity, how to search for a number in an array (sorted and not sorted cases) - Coding question: reverse a single linked list
Given a vector of integer elements. Remove the duplicates. Do not change the order of elements.
giving numbers 2,3,5,7,11 , 1.multiply each number by 2, 2.if the result is bigger than 25 , then go to next step, otherwise repeat the 1st step. 3. multipy the result by 3. 4. add XX 5. divide with XX. question: which number will produce maximun output
Write a function to convert First Name, Last Name to Last Name, First Name.
how will you find a digit in a specific decimal place of a very large power of 2
Viewing 1881 - 1890 interview questions