WeTeachCS Quizzes Recap

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

External documentation

A "readme.txt" file is created to serve as instructions for a software project delivered to a customer. Which choice best describes this feature? Postcondition Precondition Block comments External documentation Internal documentation

C++

A general-purpose programming language designed in the late 70s by Bjarne Stroustrup as an extension to the C language with object-oriented data abstraction mechanisms. Pascal COBOL Java Python C++ Fortran

Pascal

A procedural programming language, named in honor of a 17th century French mathematician, designed in the late 60s by Niklaus Wirth. Java Fortran Pascal C++ Python COBOL

object

A programming entity during the ACTUAL EXECUTION of a program that encapsulates data and related methods into one package. class procedure function object method

insertion sort

A sort algorithm seeks to find the best place in an already sorted portion of the list for the next unsorted item. Which sort algorithm listed below best fits this description? selection sort insertion sort merge sort quick sort

Encapsulation Encapsulation refers to the idea that an object is all packaged together in a bundle, to be used as one entity

An aspect of object oriented programming incorporating related data items and methods into a class definition, including instance variables, constructors, accessor and modifer methods is often referred to as: Polymorphism Inheritance Composition Abstraction Encapsulation

swap (pass-by-reference int [] list, pass-by-reference int index1, pass-by-reference int index2) In order for any swap function to correctly achieve the given post-condition, list must by passed by reference. Otherwise, any operations performed on the parameter list will not persist outside of the function.

Assume there is a function swap which, as a post-condition of execution, swaps the values of two indexed positions in an array parameter named list. Which of the following is the correct function declaration for this function? swap (pass-by-reference int [] list, pass-by-reference int index1, pass-by-reference int index2) swap (pass-by-value int [] list, pass-by-reference int index1, pass-by-value int index2) swap (pass-by-value int [] list, pass-by-reference int index1, pass-by-reference int index2) swap (pass-by-value int [] list, pass-by-value int index1, pass-by-value int index2)

Incremental This was an answer to the limitations of the waterfall process, using the idea that small steps would be taken in the process, with assessment taking place after each step.

Development process that achieves production in small steps, where design, implementation, and testing occur during each step. Spiral Agile Incremental Waterfall

Runtime For most languages, String variables will accept anything input from the keyboard, but more specialized variables, such as numeric values (integers and floating point values), boolean values, and characters, require more precise data entry, otherwise a runtime error will occur.

During the execution of a program, entering a String when an integer is expected is an example of a ______________ error. Logic Syntax Lexical Runtime

N steps In order to insert an element of a linked list where only the head is referenced, it requires traversing the entire list using a temporary pointer object until it reaches the last element, at which time the new element is attached to the back of the list. This will take as many steps as there are elements in the list.

If a linked list contains N elements, and only the head of the list is referenced, which statement below best describes how many steps it will take to insert another element at the back of the list? N/2 steps N steps One step N*2 steps

123423423425

List the values of the line numbers according to the sequence of the statements in the code segment below. List all digits in a row with no spaces between. The answer will be begin with the digits 123 and end with 5. 1 int x ← 0 2 while(x < 3) 3 print "*" 4 x ← x + 1 5 end while

Object Oriented

Project design strategy of using interacting objects. Bottom-Up Object Oriented Cyclical Top-Down/Step-Wise

Al true except (warm, cold)

The fundamental type of data in a computer, the binary digit, or bit, is represented in different ways. Of the choices shown, check each one that is typically used to represent a bit. warm, cold high voltage, low voltage 1, 0 true, false on, off

Top down

The general approach of having a goal in mind and then dividing the goal into sub-goals and tasks, sometimes also referred to as step-wise refinement. UML Top down Flowchart Bottom up

All of these statements represent valid opinions of the day regarding serif vs sans serif fonts.

There is an ongoing debate about which style of font is better to use, serif or sans serif. Which of the statements is considered to be true, according to current general opinions? The commonly used convention for printed work is to use a serif font for the body of the work. A sans-serif font is often used for headings, table text and captions. Sans serif fonts are considered better suited for online purposes due to the fact that monitors often have much poorer resolutions than printed works, making it more difficult to discern the small serifs. All of these statements represent valid opinions of the day regarding serif vs sans serif fonts. Serif fonts are usually easier to read in printed works than sans-serif fonts, since they help the brain more easily recognize the letter.

5C

What is the base 16 value equivalent of 92 base 10?

Trojan Disguised as legitimate software, a Trojan is a harmful piece of software that tricks users into loading and executing it on their systems. Unlike viruses and worms they do not reproduce by infecting files, nor do they self-replicate. A Virus is a type of malware that propagates by inserting a copy of itself into another program. Viruses spread when the software or document they are attached to is transferred from one computer to another.Worms are similar to viruses in that they replicate functional copies of themselves, but are standalone software that do not require a host program to propagate. A zombie is a computer connected to the Internet that has been compromised by a hacker with the intent of future damage initiated by a Trojan or virus.

A computer has been infected with a harmful piece of software that tricked the user into loading and executing it on the system, but does not reproduce or self-replicate. Which term below best describes this software? Worm Zombie Virus Trojan

Work through the pseudocode for the sort Working through the pseudocode for a sorting routine is certainly an important final step, but would not be a good first step when introducing the concept of any particular sorting routine.

A computer science teacher is planning a unit on sorting routines and is considering several approaches, including the ones listed below. Which of the activities listed below would be the LEAST effective to use when first introducing the lesson for a particular sort. Demonstrate the sort process on the board by tracing through the steps with a sample array of values, without any discussion of the code needed to implement the sort. View a video of folk dancers simulating the sort Work through the pseudocode for the sort Use playing cards to simulate the sorting process

Abstraction -- Abstraction refers to the idea that an object may have data and/or processes that are internal, but not readily accessible to the user, nor should they be, in order to protect the integrity of the object, allowing only an external interface to be used to access the internal parts in a controlled and safe manner.

A concept that indicates how an entity contains processes that work, but how they function internally is hidden from the user of that entity. Abstraction OOP Polymorphism Composition Encapsulation Inheritance

Fair Use

A legal principle that defines the limitations on the exclusive rights of copyright holders.

The printer's IP address has not been properly configured. If this is a networked printer, the IP address would indeed be an issue, but since it is directly connected to the computer, no IP address is necessary.

A new printer is being installed on a teacher's workstation, but isn't printing. The printer is plugged in, turned on, and connected properly to the computer, which is also on and functioning properly. Which of the following is NOT a likely cause of the problem. The printer's IP address has not been properly configured. The new printer was not correctly selected when the print request was made There is no paper in the printer The proper driver software has not been installed on the computer.

vacation.photos[7].raster[ 200 ][ 300 ] Consider what is an instance and what is an array of instances. vacation is an instance of Album. Therefore, to access an individual Image the reference must be vacation.photos[7]. Each instance of Image contains a field called raster which is a 2D array of pixels.

A programmer is writing pixel image editing software and has created the following data structures for use in the software: class Pixel int r, g, b class Image Pixel [][] raster class Album Image [] photos If there is a variable called vacation that is an instance of Album, which of the following is a valid way of accessing an individual Pixel? vacation.raster[ 200 ][ 300 ] vacation.photos[7].raster[ 200 ][ 300 ] vacation.photos[7].raster[ 200 ][ 300 ].r vacation[7].photos.raster[ 200 ][ 300 ]

One 1D array of a student record class that contains age, height, grade point average and class rank. Standard practice concerning records (individual collections of named data for a particular student) is to create a class representing an individual and then creating a single 1D array to contain multiple instances of the record class.

A programmer needs to store information about a list of students, including information about age, height, grade point average and class rank. Individual student names should not be stored, for privacy reasons. Which of the following represents the best data structure to accomplish this task? Separate parallel 1D arrays for age, height, grade point average and class rank One 1D array of a student record class that contains age, height, grade point average and class rank One 2D array where each row corresponds to a single student and there are separate columns for age, height, grade point average and class rank. One 2D array where each column corresponds to a single student and there are separate rows for age, height, grade point average and class rank.

8

Consider the following block of code: Queue q ← new Queue () q.push( 9 ) q.push( 3 ) q.push( 6 ) q.peek( ) q.pop( ) q.push( 8 ) q.push( 9 ) q.pop( ) q.pop( ) What is returned by a subsequent call to q.peek( )? 3 9 6 8

Minimum Heap The state of a minimum heap is that the root node is always the smallest value, and is optimal for implementing a priority queue, where the root is removed each time during a pop operation. The last element of the tree is placed in the root position after the pop operation, and the min heap state is restored, ready for the next pop operation.

A special kind of queue is required where elements are inserted in natural ascending order, often called a priority queue. The element popped from the front of this queue is always the smallest item in the list. Which of the following data structures will best implement this requirement? Binary Search Tree Linked List Array Minimum Heap

UML/Unified Modeling Language A UML diagram can be used to show all aspects of OOP design, including abstraction, encapsulation, inheritance, composition, and polymorphism.

A visual organizer developed to graphically show objects and their contents. Pseudocode Flowchart Syntax Diagram UML/Unified Modeling Language

Since all positions are filled at all levels, this is a full, complete, and balanced tree.

After the integer elements 5, 3, 7, 1, 2, 4 are correctly inserted into a minimum heap tree, with the value 5 as the initial root, and the value 6 added to the heap, which term or terms below best describes the resulting tree? Check all that apply. Complete tree Full tree Balanced tree

1 2 5 3 4 7 The heap insertion process starts with 5 as the root, which is then switched with the 3 when that is added to the left, in order to restore the min heap state (all parents less than kids). The 7 is added to the right, with no adjustment necessary. When the 1 is added to the left of the 3, it must be moved all the way to the root, moving the 5 and 3 down the left subtree one level each. When the 2 is added to the right of the 3, those two elements must be switched to maintain the min heap state. The 4 is added to the left of the 7, and then those two values are switched, resulting in the tree with 1 as the root, 2 and 4 at the next level, and 5, 3, and 7 at the lowest level. 5 3 3 1 1 1 / / \ / \ / \ / \ 5 5 7 3 7 2 7 2 4 / / \ / \ / 5 5 3 5 3 7 The pre-order traversal starts at the root and retrieves the value of each node as it is visited on the left, starting with the 1, then the 2, 5, 3, 4, and 7.

After the integer elements 5, 3, 7, 1, 2, 4 are correctly inserted into a minimum heap tree, with the value 5 as the initial root, which choice below represents the pre-order traversal of the tree? 5 3 2 7 4 1 1 2 5 3 4 7 1 2 3 4 5 7 5 2 3 1 7 4

1 2 3 4 5 7

After the integer elements 5, 3, 7, 1, 2, 4 are correctly inserted into an ascending order binary search tree, what is the resulting inorder traversal? 5 3 1 2 7 4 . 1 2 5 3 4 7 1 2 3 4 5 7 5 3 1 2 4 7

214375

After the integer elements 5, 3, 7, 1, 2, 4 are correctly inserted into an ascending order binary search tree, what is the resulting post-order traversal? 5 3 1 2 7 4 5 3 1 2 4 7 2 1 4 3 7 5 1 2 3 4 5 7

Lexical Any word related error, including mixed up order of commands or misspelling, is considered a lexical error. (Another example of a lexical error -- The name of the class does not match exactly the name of the file, which is a requirement for Java programs.)

Arranging commands in a programming statement not in the required order is a ______________ error. Syntax Logic Runtime Lexical

temp.next is equal to null

Assume there is a function tail which returns a reference to the last Node of a linked list, given the head Node. For this problem, also assume there is a non-empty linked list reference declared as list. Now consider the following line of code: Node temp ← tail ( list ) Immediately after this line of code is executed, which of the following conditions will be true, according to the post-condition of tail temp is equal to null temp.next.item is equal to null temp.next is equal to null temp.item is equal to 0

Rule This is a convention that is common to many languages.

Choose the statement that best classifies the identifier creation guideline shown. Class names start with an upper case letter Good idea Convention Rule

Rule This is the primary rule for creating identifiers.

Choose the statement that best classifies the identifier creation guideline shown. Contains only alphanumeric characters, or the underscore character Rule Good idea Convention

Upon declaration of englishClass, individual elements contain a Student with age 0 and a blank name When creating an array of objects, the individual elements of the array are blank, and contain no Student objects (some languages use the value null to indicate this) until they are individually assigned with a new instance, such as with englishClass[2] ← new Student()

Consider the following class Student: class Student int age string name Now consider the following array: Student[] englishClass = new Student [ 10 ] Assuming no other code has been executed, which of the following statements is false? englishClass can contain up to 10 instances of Student The length of englishClass can be determined Each element of englishClass is currently blank. Upon declaration of englishClass, individual elements contain a Student with age 0 and a blank name

{ 1, 2, 3, 4, 7, 9, 6, 5, 8 } Working from the outside ends of the list towards the pivot value, a quick sort pass will swap elements on either side of the pivot that are on the wrong side. During this process, a right side index and left side index move toward the pivot and swap "out of position" values. In this case, 6 and 2 will swap positions and 7 and 3 will swap positions.

Consider the following list: { 1, 6, 7, 4, 3, 9, 2, 5, 8 } If the entire list is undergoing the initial partitioning pass using a quick sort process, with the middle value as the pivot, what will the list look like after the first pass? { 1, 6, 7, 4, 3, 9, 2, 5, 8 } { 1, 2, 3, 4, 7, 9, 6, 5, 8 } { 1, 2, 7, 4, 3, 9, 6, 5, 8 } { 1, 6, 4, 3, 7, 2, 5, 8, 9 }

merge sort The code shows the list being repeatedly divided into two halves, with no regard to the actual values contained, using a recursive process. The rest of the code merges each pair of divided lists back into the larger list in sorted order, resulting in a final sorted list. This is the nature of the merge sort.

Consider the following partial pseudocode for a sort: void sort(pass-by-reference int [] list, int lo, int hi ) if ( lo ≠ hi ) sort( list, lo, (lo + hi) / 2 ) sort( list, (lo + hi) / 2 + 1, hi) end if ...more code here end void Which sort is this code most likely to represent? merge sort quick sort selection sort insertion sort

y == x + 1 One way to work through this problem is to pick a number and plug it in.

Consider the following pseudocode segment with integer variables, where the initial variable assignments at the beginning of the segment are missing. // missing precondition x ← x + 1 y ← y + x // postcondition: // y == 2 * x Which of the following would be a valid precondition for the code segment above? y == x + 2 y == x + 1 y == x - 1 y == x

The if statement detects a section of the list that is too small to partition any further and ends execution for that part of the process. If the size of the partition is 1 (lo is equal to hi), or zero (lo is greater than hi), a base case of the quick sort process has been reached with this partition, and no attempt will be made to further partition this segment of the list.

Consider this partial pseudocode segment for a quick sort, given a lo and hi index representing the inclusive bounds of the partition to be sorted. void quickSort(pass-by-reference int [] list, int lo, int hi ) if ( lo ≥ hi ) return end if ...more code here What is the purpose of the if statement in this pseudocode? The if statement detects a section of the list that is too small to partition any further and ends execution for that part of the process. The if statement detects that the entire list has been sorted and ends execution. The if statement detects new bounds of a partition and returns it. The if statement detects a pivot value and returns it.

10,000

For a list of 1000 elements, using a process that is considered to have an O(N log N) running time in all situations, what value below represents the approximate number of steps it will take for the algorithm to complete its task? 1000 1,000,000 10,000 100 10

The left child of 3 When inserting into a heap, the first step is to insert new elements where they will maintain heap "completeness." In this case, that position would be the left child of 3. After insertion, the heap state must be maintained, otherwise referred to as "heapify" in the video lectures of this curriculum. The new element is verified to make sure that it is greater than its parent, for a minimum heap tree. If it is less than its parent, the tree must be re-arranged until either it has a parent less than itself or it has become the root of the heap.

If the value 4 is inserted, where would its final position be after the heap state was maintained? The left child of 3 The right child of 3 The root of the heap The left child of 7

Actual Variables in method calls are called actual parameters, and those in method headers are called formal parameters. String name is the actual parameter, and String n is the formal parameter.

In this pseudocode example, String name is an example of a(an) __________ parameter. void sayHello(String n) print("Hello "+ n +"!") end of sayHello void main String name = "Suzy" sayHello(name) end of main Formal Actual Value Reference

class The class is the definition of the "thing", and the object IS the "thing".

The definition of an object in OOP, describing the type of data owned by the object, as well as methods that act on that data. procedure class object method function

25257875

What is the complete output of this pseudocode segment? The answer contains exactly 8 single digits with no spaces between. void doStuff (passed_by_reference int x, passed_by_value y) print(x + "" + y) x ← x + 5 y ← y + 3 print(x + "" + y) end doStuff void main int a ← 2 int b ← 5 print(a + "" + b) doStuff(a, b) print(a + "" + b) end main

10 11 13 The sequence continues as shown: 5,6,7,10,11,12,13,14

Select all choices listed below that are within the next five values in this base 8 sequence. 5, 6, 7 11 9 13 10 8

All are true except: There are just over 4 billion possible IPv6 addresses.

Select all statements that are correct regarding IP addresses. IPv4 addresses are often expressed in dotted decimal format. The IPv6 system was developed because the demand for addresses had exceeded the supply provided by IPv4. There are just over 4 billion possible IPv6 addresses. IPv4 addresses consist of 32 bits. IPv6 addresses consist of 128 binary digits.

true

Select the choice representing the final value of this Boolean expression. TRUE AND FALSE OR TRUE XOR FALSE

methods or functions by way of the interface. Remember the design concept of abstraction? The idea in a library of code is that someone else has worried about the details of how the methods and functions work. You should access those blocks of code using the interfaces provided, instead of trying to delve into the source or the details.

The most appropriate way to use a library of program code is to access the: implementation details of the methods or functions. methods or functions by way of the interface. methods or functions by way of the source code. documentation of the methods or functions.

Stepwise refinement

The process of breaking down large modules of a project into smaller, more manageable modules, a key part of the top down design process. Bottom-up UML Flowchart Stepwise refinement

Testing

The stage in the software system life cycle that checks the program for reliability, validity, and effectiveness. Design Testing Analysis Implementation (Coding) Maintenance

Maintenance -- Maintenance takes the most time since it must be maintained throughout its useful life, which will usually span much longer than it took to develop it.

The stage in the software system life cycle that takes the most amount of time. Design Testing Analysis Maintenance Implementation (Coding)

1

What is output by this pseudocode segment? int f(int x) if(x > 0 AND x % 2 == 0) return 2 else if(x > 0 AND x % 2 == 1) return -1 else return f(x + 5) + f(x + 8) end if else chain end f //client code print f(-10)

int x ← 0 ; x < 10; ++x int x ← 1 ; x ≤ 10 ; x++ int x ← 5 ; x < 33; x+= 3

Which <start>, <check> and <step> options in the choices below will cause the action of this loop to occur 10 times? (can be more than one choice) <start> do{ <action> <step> }while(<check>) int x ← 0 ; x ≤ 10; ++x int x ← 1 ; x < 10; x++ int x ← 0 ; x < 10; ++x int x ← 1 ; x ≤ 10 ; x++ int x ← 5 ; x < 33; x+= 3

A switch preserves bandwidth, where a hub dilutes bandwidth. A switch uses technology that maintains the same bandwidth for all devices, regardless of how many are connected, whereas a hub spreads out the bandwidth among all connected devices, causing less bandwidth available to each one, effectively slowing the performance of the network. Both devices come in all sizes, and both are about the same in use of electrical energy.

Which choice below best describes the reason a switch is a better device than a hub to serve as the center of a star topology. A switch uses less electrical energy than a hub. A switch can handle more connections than a hub. A switch preserves bandwidth, where a hub dilutes bandwidth. All of these reasons are valid.

Graph A graph is a collection of interconnected nodes, or vertices, with edges that are directed or undirected, linking them together into a system of nodes, which could represent a roadmap of system of interconnected tasks in a large project.

Which choice below is best described by the following statement? Data structure containing several nodes, often called vertices, which are connected to other nodes using edges, which can be directed or undirected. Tree Queue Array Graph Linked List Stack

UML diagram

Which choice below represents the type of diagram used to represent the structure of objects in OOP? Backus Naur notation UML diagram Flowchart Syntax Diagram

Inheritance Inheritance is a key feature of OOP, where new objects are based on previously created, defined, and tested objects, streamlining the software development process.

Which choice best describes the feature of OOP that allows for classes to be defined based on previously defined and developed classes, receiving all of the characteristics of the original class, and then expanding on those features, easily identified as an "is a" relationship. Encapsulation Abstraction Inheritance Polymorphism Composition

Spiral Similar to the incremental process, an additional risk assessment is included in the process, deciding whether any change considered is a risk worth taking in the whole process.

Which choice represents a development process combining features of other development models into a cyclical process, including several phases, one of which is risk analysis. Waterfall Spiral Incremental Agile

23

Which choice shows an input value for num to produce the output shown below? int x ← 0 int num input num for(x ← 14; x < num ; x += 2) print "*" print x //OUTPUT *****24 25 23 21 27

passed_by_reference int x, passed_by_reference y

Which choice shows the correct parameter signature for the doStuff method header based on the final output shown below? void doStuff (passed_by_?? int x, passed_by_?? y) x ← y + 5 y ← x - 7 end doStuff void main int a ← 8 int b ← -4 doStuff(b, a) print(a + ":" + b) end main //OUTPUT 6:13

Graph

Which data structure below is characterized by nodes representing data objects connected by edges that can have direction and weight? Linked List Stack Tree Queue Graph

Polymorphism - polymorphic referencing This is an example of a polymorphic object, which is a parent object able to reference any of its descendant objects.

Which object-oriented programming concept is described by the following: A parent class J has child classes K and L, and can reference objects of either class. Polymorphism - overloading Encapsulation Composition Polymorphism - polymorphic referencing Inheritance Polymorphism - overriding

VGA A USB cable has 4 or five pins and comes in several different configurations. An HDMI connector is the newest connector used for monitor connection, and also provides audio. The serial connector is the oldest version with 9 pins that can be customized in various ways, depending on the application.

Which of the choices below indicates a connector that has 15-pins and is used to connect a computer to a monitor. HDMI VGA USB Serial

TCP/IP (Transmission Control Protocol/Internet Protocol)

Which of the choices below indicates the network protocol that controls the entire internet? SMTP TCP/IP RIP OSI

11000111 base 2 (correct) C3 base 16 = 195 base 10 304 base 8 = 196 base 10 11000111 base 2 = 199 base 10

Which of the choices listed represents the greatest value? 196 base 10 C3 base 16 11000111 base 2 304 base 8

All of these strategies are valid depending on the situation.

Which of the following are considered good program debugging strategies? Check all that apply. Look at the arrows in the compiler generated error messages to locate the error. Intentionally use bad data to see if your program can handle it. Read the error messages provided by the compiler. Hide portions of the program that don't seem to work and "unhide" them one at a time until the offending line is discovered.

To describe the classes and methods to be used in a program

Which of the following best describes the purpose of generating a unified modeling language diagram as part of the design of a computer program? To present the steps needed to solve the programming problem To test and maintain the efficiency of the overall program To determine the necessary number of global and local variables To describe the classes and methods to be used in a program

An O(1) process only works on a data set of 100 items or less. The nature of an O(1) process is that, regardless of the size of the data set, it takes one step to achieve the task.

Which of the following descriptions of the Big O analysis categories is NOT correct? An O(N2) process is characterized by a nested loop process based on the size of the data set. An O(N) process is characterized by a loop that spans the entire data set of size N. An O(N log N) process is characterized by a divide and conquer process combined with an N based loop. An O(1) process only works on a data set of 100 items or less.

The target value must be contained within the list

Which of the following is NOT a true statement about the binary search process? The average case scenario Big O running time is O(log N). The precondition is that the list must be sorted. The target value must be contained within the list. The process checks the middle item for a match, and then looks to the right or to the left if it doesn't match, repeating this process until a match is found, or not.

Every parent node in a maximum heap tree is less than or equal to its children.

Which of the following is NOT a true statement? Every parent node in a maximum heap tree is less than or equal to its children. A leaf in a binary tree is a node that has no children. The root node of a binary search tree is less than its right child. For a binary search process, the precondition is that the list must be sorted.

Merge Sort Due to the "divide and conquer" nature of the merge sort, it is considered an O(N log N) class sort for all cases, average, worst, and best. The quick sort is also considered O(N log N) for best and average cases, but not in the worst case scenario, when its running time is considered to be O(N^2).

Which of the following is considered an O(N log N) class sort for a worst case scenario? Selection Sort Merge Sort Quick Sort Insertion Sort

PNG Compared to JPEG, PNG excels when the image has large, uniformly colored areas. Even for photographs - where JPEG is often the choice for final distribution since its compression technique typically yields smaller file sizes - PNG is still well-suited to storing images during the editing process because of its lossless compression. BMP files are uncompressed, and therefore large and lossless. TIFF image format is not widely supported by web browsers. (https://en.wikipedia.org/wiki/Image_file_formats)

Which of the following picture file formats is best-suited for use with web pages, and for storing images during the editing process because of its lossless compression? TIFF BMP JPEG PNG

An in-order traversal of a binary search tree will always traverse elements in order of ascending values Every child node in a binary search tree to the right of a parent node will always be greater than, but not equal to, the parent node.

Which of the following statements is NOT true for binary search trees, as described in this curriculum? The root node is the value that was inserted first An in-order traversal of a binary search tree will always traverse elements in order of ascending values Every child node to the left of a node is less than or equal to the parent node Every child node to the right of a node is greater than or equal to the parent node

push is analagous to enqueue Push is analogous to enqueue in that both add elements to their respective data structures. Peek is not functionally the same for both stacks and queues, because it will return the newest element of a stack, whereas in a queue it will return the oldest element.

Which of the following statements is true about stacks and queues? push is analagous to enqueue peek is functionally the same for both stacks and queues pop is analagous to enqueue push is analagous to dequeue

The tree is always complete Minimum heap trees always maintain two conditions - that they are complete (with the every parent node having two children except for the last level, wherein all nodes must be to the left) and that each parent must be less than its two children. A minimum heap tree may not always be full (with every parent node having two children and the last level being completely filled). Trees which specify that left child nodes are always less than their parent nodes are typically binary search trees. One special property of minimum heap trees is that the root is always the least value.

Which of the following statements is true for all minimum heap trees? The root is always the median value Left child nodes are always less than their parent nodes The tree is always complete The tree is always full

Indeed, all of the statements are true regarding the use of loops and recursion.

Which of the statements listed below are true regarding the use of loops and recursion? Check all that apply. There are some things a recursive process can do that a loop cannot or does with great difficulty. Use a loop when possible, and only use recursion when a loop is not possible, or is less effective. Loops are more memory efficient than recursive processes. Both loops and recursion are processes used to repeat tasks in a program.

Iteration, looping and recursion are all terms that refer to processes involving code repetition.

Which of these terms refer to the general process of repeating code elements inside a program? Check all that apply. sequence branching recursion looping iteration

Values are accessed using an indexing process, where the first index represents the column, and the second represents the row. (row by column is correct way)

Which statement listed below is NOT true about two dimensional arrays? The number of columns in each row can be different. Values are accessed using an indexing process, where the first index represents the column, and the second represents the row. All elements contained in the array must be of the same data type. Values for each row are stored in contiguous memory.

result ← result + i

int f(num) int result ← 0 for (int i ← num; i >= 1; i ← i - 1) /*Missing For Body*/ end for return result end f If the value of result at the end of the method call f(10) is 55, which of the following statements should replace /*Missing For Body*/? result ← result * i result ← result * num result ← result + i result ← result + num

1 3 6 10 15

int n ← 0 int x ← 0 while(n < 5) n ← n + 1 x ← x + n print x + " " end while What is the output of the code segment shown? 1 2 3 4 5 0 1 2 3 4 5 0 1 3 6 10 15 1 3 6 10 15

2 4 6 8 (x increased before the print statement) The inside of the loop has the instructions to increment x by 2, then print the value of x every time the loop runs. Therefore, the output of this method will be 2 4 6 8. Note that x is incremented before being printed, so the method will not print 0. Since the value changes to 8, then prints before the check condition is false, the 8 is printed.

void main () int x ← 0 while (x < 8) x ← x + 2 print x + " " end while end main What would be the output of the main method? 2 4 6 8 0 2 4 6 2 4 6 0 2 4 6 8


संबंधित स्टडी सेट्स

Chapter 66: Caring for Clients with Burns

View Set

CH04: Carbohydrates, HN 196 Chapter 4 - Carbohydrates, mastering nutrition 4-6, chapter 3

View Set

Fundamentals Test 2 Prep U Oxygenation

View Set

5 : Biochemical activity of the thyroid and parathyroid hormones

View Set

Handling and Restraint Self Check 1

View Set

NRRPT Prep Applied Radiation Protection

View Set