Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java in independent because : It is a compiled language It is an interpreted lan

ID: 3584244 • Letter: J

Question

Java in independent because : It is a compiled language It is an interpreted language Existence of JVM All of the above. Robustness of such a program means: The program is able to handle the unexpected inputs. able to evolve over time in response to changing conditions in its environment The same code can be usaed as a component of different systems in various applications. None of the above. Ordered arrays, compared with unordered arrays, are Much quicker at deletion. Quicker at insertion. Quicker to create. Quicker at searching Big O notation tells How the speed of an algorithm relates to the number of items. The running time of an algorithm for a given size data structure. The running time of an algorithm for a given number of items. How the size of a data structure relates to the number of items Suppose we are working with lists which have no head node, use single links, and are not circular; the list pointer L points to the first node in the list. The data is in a field called data, and the pointer to the next node is in a field called next. Here is some code to insert a new element with data 'A' at the beginning of the list. Under which of these conditions would it fail? x = a new node: x.setElement(A); x.setNext(L); L = x; The list is empty The list has an odd number of nodes The list has just one node None of these (i.e., it does not fail in any of these cases) When might Insertion Sort be an efficient way of sorting a large array? All elements in the array are odd numbers The values in the array are not necessarily in order, but are all integers in the range 1 to n. The array is already nearly ordered. All permutations of the elements in the array are equally likely

Explanation / Answer

(1)D

Java uses a two step compilation process. Java source code is compiled down to "bytecode" by the Java compiler. The bytecode is executed by Java Virtual Machine (JVM). The current version of Sun HotSpot JVM uses a technique called Just-in-time (JIT) compilation to compile the bytecode to the native instructions understood by the CPU on the fly at run time.

Some implementations of JVM might interpret the bytecode instead of JIT compiling it to machine code and running it directly. While this is still considered an "interpreter." It's significantly different from interpreters that read and execute the high level source code (i.e. in this case, Java source code is not interpreted directly, the bytecode, output of Java compiler, is.) To summarize, depending on the execution environment, bytecode can be: compiled ahead of time and executed as native code (similar to C++) compiled just-in-time and executed interpreted directly executed by a supported processor (bytecode is the native instruction set of some CPUs)

(2)A

Robust programming, also called bomb-proof programming, is a style of programming that prevents abnormal termination or unexpected actions. Basically, it requires code to handle bad (invalid or absurd) inputs in a reasonable way. If an internal error occurs, the program or library terminates gracefully, and provides enough information so the programmer can debug the program or routine.

(3)ABCD

Although there are some similarities between arrays and lists, they are used for different purposes. An array is a contiguous segment of memory, and a list is just a bunch of nodes, each one has the pointers to the "next" node (and also to the "previous" node, in the case of bidirectional lists). Arrays efficiently - in O(1) - support random access (i.e. by arbitrary given index i), but deleting/inserting an element into an array is slow - O(n), because you have to move all elements after deleting/inserting element. Lists, on the other hand, do not support efficient random access (while supporting efficient consecutive traversal), but inserting and deleting is fast - O(1).

(4)C

OBVIOUS

(5)C

It is because in x.Setnext(L) It is made pointed to itself So only one element

(6)C

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote