{"id":111331,"date":"2023-08-02T18:55:53","date_gmt":"2023-08-02T18:55:53","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=111331"},"modified":"2023-08-02T18:56:00","modified_gmt":"2023-08-02T18:56:00","slug":"wgu-c949-data-structures-and-algorithms-i-objective-assessment-exam-300-questions-and-correct-detailed-answers-with-rationales-verified-answers-agrade","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2023\/08\/02\/wgu-c949-data-structures-and-algorithms-i-objective-assessment-exam-300-questions-and-correct-detailed-answers-with-rationales-verified-answers-agrade\/","title":{"rendered":"WGU C949 DATA STRUCTURES AND ALGORITHMS I OBJECTIVE ASSESSMENT EXAM 300 QUESTIONS AND CORRECT DETAILED ANSWERS WITH RATIONALES (VERIFIED ANSWERS) |AGRADE"},"content":{"rendered":"\n<p>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Which statement describes a queue data structure? D<br>A.) It is a sequence of elements in which insertion and<br>deletion takes place at one end.<br>B.) It is a sequence of elements in which insertion and<br>deletion takes place at both ends.<br>C.) It is a sequence of elements in which insertion<br>can take place anywhere in the sequence and deletion<br>takes place only at the front.<br>D.) It is a sequence of elements in which insertions<br>can take place only at the back end and deletions can<br>take place only at the front end.<\/li>\n\n\n\n<li>Which data structure allows inserting and deleting B<br>data elements at both the front and the rear?<br>A.) Trees<br>B.) Deques<br>C.) Stacks<br>D.) Queues<\/li>\n\n\n\n<li>Which data structure allows elements to be inserted C<br>and deleted from one end and provides no direct access to the other end?<br>A.) List<br>B.) Deque<br>C.) Stack<br>D.) Queue<\/li>\n\n\n\n<li>What are the official indexes for the list list01 given A<br>this declaration?<br>int[ ] list01 = {0, 2, 4, 6, 8, 10};<br>A.) 0, 1, 2, 3, 4, 5<br>B.) 0, 2, 4, 6, 8, 10<br>C.) 1, 2, 3, 4, 5, 6<br>D.) 2, 4, 6, 8, 10, 12<br>1 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<\/li>\n\n\n\n<li>Which abstract data type (ADT) has elements of the A<br>same type so that the elements can be retrieved based<br>on the index or position?<br>A.) List<br>B.) Bag<br>C.) Stack<br>D.) Queue<\/li>\n\n\n\n<li>Which data structure allows insertion and removal C<br>from only one end of the data structure?<br>A.) List<br>B.) Queue<br>C.) Stack<br>D.) Deque<\/li>\n\n\n\n<li>Which data type does the mystery function return?re- C<br>turn_type mystery (int R)<br>{<br>int NumUnits = R;<br>return NumUnits * 3.14;<br>}<br>A.) Byte<br>B.) String<br>C.) Double<br>D.) Boolean<\/li>\n\n\n\n<li>Which category of data does (&#8220;FB&#8221;, 75.00, 75.03, 74.90) C<br>represent in the pseudocode?<br>import datetime<br>def middle(stock, date):<br>symbol, current, high, low = stock<br>return (((high + low) \/ 2), date)<br>mid_value, date = middle((&#8220;FB&#8221;, 75.00, 75.03, 74.90),<br>datetime.date(2014, 10, 31))<br>2 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>A.) List<br>B.) Float<br>C.) Tuple<br>D.) Operator<\/li>\n\n\n\n<li>Which value is appropriate for Test1 given the expres- A<br>sion?<br>char Test1;<br>A.) &#8216;L&#8217;<br>B.) 77<br>C.) 6.5<br>D.) &#8220;value&#8221;<\/li>\n\n\n\n<li>Which value is appropriate for the variable middle A<br>given the pseudocode?<br>function mystery()<br>{<br>string last;<br>string first;<br>char middle;<br>int phone;<br>float rate;<br>}<br>A.) &#8216;D&#8217;<br>B.) &#8216;Da&#8217;<br>C.) &#8220;david&#8221;<br>D.) &#8220;David&#8221;<\/li>\n\n\n\n<li>Which type of operation is represented in the B<br>pseudocode?<br>int x,y,z;<br>x=y=z=100;<br>3 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>A.) Ternary<br>B.) Assignment<br>C.) Comparison<br>D. Equality<\/li>\n\n\n\n<li>What is the most efficient data type to use for this data C<br>set of a fixed size in Java?<br>a = [0, 0, 1, 4, 7, 16, 31, 64, 127]<br>A.) List<br>B.) Tuple<br>C.) Array<br>D.) Dictionary<\/li>\n\n\n\n<li>Which data type is appropriate for this array to store D<br>the given data?<br>a = [&#8220;AF&#8221;, &#8220;71&#8221;, &#8220;BC&#8221;, &#8220;157&#8221;, &#8220;BA&#8221;, &#8220;253&#8221;]<br>A.) Byte<br>B.) Char<br>C.) Short<br>D.) String<\/li>\n\n\n\n<li>Which data type is appropriate for the given data set? A<br>a = [1, 717, 23, 12, 314, 6]<br>A.) Int<br>B.) Byte<br>C.) Char<br>D.) Boolean<\/li>\n\n\n\n<li>Which data type should be used for this object? B<br>days = { &#8220;Sunday&#8221;, &#8220;Monday&#8221;, &#8220;Tuesday&#8221;, &#8220;Wednesday&#8221;, &#8220;Thursday&#8221;, &#8220;Friday&#8221;, &#8220;Saturday&#8221;}<br>A.) Float<br>4 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>B.) String<br>C.) Integer<br>D.) Boolean<\/li>\n\n\n\n<li>Which data type should be used for this variable? C<br>phoneNum = &#8220;212-555-1212&#8221;<br>A.) Long<br>B.) Short<br>C.) String<br>D.) Integer<\/li>\n\n\n\n<li>What is true about garbage collection? D<br>A.) It is often portrayed as the same as manual memory management.<br>B.) It is no longer a primary concern since memory is<br>very inexpensive.<br>C.) It is scheduled to take place at regular time intervals to reclaim memory.<br>D.) It reclaims memory from data structures implemented using linked allocations.<\/li>\n\n\n\n<li>What is true about a data structure implemented using B<br>linked allocation?<br>A) Elements may not be added once the data structure<br>is filled.<br>B.) Storage is allocated using pointers to new locations as needed.<br>C.) The amount of memory used is no greater than a<br>sequential allocation version.<br>D.) An empty structure uses more memory compared<br>to a version using sequential allocation.<\/li>\n\n\n\n<li>What are the array elements corresponding to the B<br>mid-values in the first and second iterations of a binary search in an array arr = {45, 77, 89, 90, 94, 99, 100}<br>and key = 100?<br>5 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>A.) 89 and 94<br>B.) 90 and 99<br>C.) 94 and 99<br>D.) 90 and 100<\/li>\n\n\n\n<li>What is the effect on the object Computing regarding B<br>garbage collection?<br>Computing obj = new Computing(); obj = null;<br>A.) It is partially available for garbage collection.<br>B.) It is automatically available for garbage collection.<br>C.) It is a Computing object that is already null, which<br>does not require garbage collection.<br>D.) It is a Computing constructor that has no parameters, and is not available for garbage collection.<\/li>\n\n\n\n<li>What are the mid-values in the first and second levels D<br>of recursion in this binary search?<br>int arr = {46, 76, 89, 90, 94, 99, 100} and key = 99<br>A.) 89 and 94<br>B.) 89 and 99<br>C.) 90 and 94<br>D.) 90 and 99<\/li>\n\n\n\n<li>Which data set is represented using the dictionary D<br>data type?<br>A.) A set of book titles<br>B.) A set of Celsius temperatures<br>C.) A set of soda cans in a refrigerator<br>D.) A set of students and their test scores<\/li>\n\n\n\n<li>What is a characteristic of keys in an associative dic- B<br>tionary data type?<br>A.) They are unique and mutable.<br>6 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>B.) They are unique and immutable.<br>C.) They are non-unique and mutable.<br>D.) They are non-unique and immutable.<\/li>\n\n\n\n<li>Which method can be used to take a value out of a D<br>dictionary?<br>A.) D1[key].pop(value)<br>B.) D1[key].pull(value)<br>C.) D1[key].delete(value)<br>D.) D1[key].remove(value)<\/li>\n\n\n\n<li>Given this data dictionary in Python: C<br>dict = {&#8216;white&#8217;:0x0000, &#8216;black&#8217;:0x1111}<br>Which command\/function generates the output<br>[&#8216;white&#8217;,&#8217;black&#8217;]?<br>A.) dict_keys()<br>B.) keys_values()<br>C.) dict.keys()<br>D.) keys.values()<\/li>\n\n\n\n<li>The reference of the head of the doubly linked list is C<br>passed to the reverse() method:<br>1&lt;&#8211;&gt;2&lt;&#8211;&gt;3&lt;&#8211;&gt;4&lt;&#8211;&gt;5&lt;&#8211;&gt;6<br>What is the modified linked list when complete?<br>A.) 2&lt;&#8211;&gt;1&lt;&#8211;&gt;4&lt;&#8211;&gt;3&lt;&#8211;&gt;6&lt;&#8211;&gt;5<br>B.) 5&lt;&#8211;&gt;4&lt;&#8211;&gt;3&lt;&#8211;&gt;2&lt;&#8211;&gt;1&lt;&#8211;&gt;6<br>C.) 6&lt;&#8211;&gt;5&lt;&#8211;&gt;4&lt;&#8211;&gt;3&lt;&#8211;&gt;2&lt;&#8211;&gt;1<br>D.) 6&lt;&#8211;&gt;5&lt;&#8211;&gt;4&lt;&#8211;&gt;3&lt;&#8211;&gt;1&lt;&#8211;&gt;2<\/li>\n\n\n\n<li>Which data structure is indexed? B<br>A.) Heap<br>B.) Array<br>7 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>C.) Linked list<br>D.) Directed graph<\/li>\n\n\n\n<li>Which data structure may only store homogeneous A<br>data elements?<br>A.) Arrays<br>B.) Classes<br>C.) Dictionaries<br>D.) Linked lists<\/li>\n\n\n\n<li>What is a hierarchical data structure? B<br>A.) List<br>B.) Tree<br>C.) Array<br>D.) Linked list<\/li>\n\n\n\n<li>What is an attribute of a binary tree? A<br>A.) Each node has at most two children.<br>B.) The root node is empty in a full tree.<br>C.) The leftmost child is null in a full tree.<br>D.) The rightmost child is null in a full tree.<\/li>\n\n\n\n<li>Which data structure uses a last in, first out (LIFO) C<br>removal of items?<br>A.) Tree<br>B.) Queue<br>C.) Stack<br>D.) Dictionary<\/li>\n\n\n\n<li>Given: B<br>heapList = [22, 33, 44, 55, 66]<br>Which index is the right child of item 22?<br>A.) 33<br>8 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>B.) 44<br>C.) 55<br>D.) 66<\/li>\n\n\n\n<li>Items were added sequentially in this stack starting A<br>with &#8216;ham&#8217;:<br>&#8216;sausage&#8217;<br>&#8216;toast&#8217;<br>&#8216;eggs&#8217;<br>&#8216;ham&#8217;<br>What is the correct order of contents after the push<br>operation is performed with the value &#8216;bacon&#8217;?<br>A.) &#8216;bacon&#8217;<br>&#8216;sausage&#8217;<br>&#8216;toast&#8217;<br>&#8216;eggs&#8217;<br>&#8216;ham&#8217;<br>B.) &#8216;sausage&#8217;<br>&#8216;toast&#8217;<br>&#8216;eggs&#8217;<br>&#8216;ham&#8217;<br>&#8216;bacon&#8217;<br>C.) &#8216;sausage&#8217;<br>&#8216;toast&#8217;<br>&#8216;eggs&#8217;<br>&#8216;bacon&#8217;<br>&#8216;ham&#8217;<br>D.) &#8216;sausage&#8217;<br>&#8216;bacon&#8217;<br>&#8216;toast&#8217;<br>&#8216;eggs&#8217;<br>&#8216;ham&#8217;<\/li>\n\n\n\n<li>Items were added sequentially in this stack starting D<br>with &#8220;dog&#8221;:<br>&#8220;bird&#8221;<br>&#8220;rabbit&#8221;<br>9 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>&#8220;cat&#8221;<br>&#8220;dog&#8221;<br>What is the return value of the pop operation?<br>A.) &#8220;dog&#8221;<br>B.) &#8220;cat&#8221;<br>C.) &#8220;rabbit&#8221;<br>D.) &#8220;bird&#8221;<\/li>\n\n\n\n<li>Which sequence of letters represents preorder traver- B<br>sal of the nodes of this tree?<br>A.) A B C D E F G H I<br>B.) A B C D F E G I H<br>C.) B A D F C I G E H<br>D.) B F D I G H E C A<\/li>\n\n\n\n<li>An array soc of size 1009 is used where the index is an B<br>integer in [0,1008] and the hash-function key%1009.<br>Where will the data associated with the key given by<br>the last 4 social security digits &#8216;2023&#8217; be stored?<br>A.) In soc[4]<br>B.) In soc[5]<br>C.) In soc[1009]<br>D.) In soc[2023]<\/li>\n\n\n\n<li>A stack s, a queue q, and a max value priority queue C<br>p each have a single 3 in them. Next s.push(4),<br>q.push(4), and p.push(4) are executed.<br>10 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>What is the triple (s.pop(), q.pop(), p.pop())?<br>A.) (3,4,4)<br>B.) (4,3,3)<br>C.) (4,3,4)<br>D.) (4,4,3)<\/li>\n\n\n\n<li>This stack reads left to right with the top to the right: C<br>&#8216;green&#8217;<br>&#8216;yellow&#8217;<br>&#8216;blue&#8217;<br>&#8216;red&#8217;<br>What could be the stack after a push operation?<br>A.) [&#8216;red&#8217;,&#8217;blue&#8217;,&#8217;yellow&#8217;]<br>B.) [&#8216;blue&#8217;,&#8217;yellow&#8217;, &#8216;green&#8217;]<br>C.) [&#8216;red&#8217;,&#8217;blue&#8217;,&#8217;yellow&#8217;, &#8216;green&#8217;, &#8216;purple&#8221;]<br>D.) [&#8216;purple&#8217;, &#8216;red&#8217;,&#8217;blue&#8217;,&#8217;yellow&#8217;, &#8216;green&#8217;]<\/li>\n\n\n\n<li>Items were added sequentially onto the stack starting A<br>with &#8216;red&#8217;:<br>&#8216;green&#8217;<br>&#8216;yellow&#8217;<br>&#8216;blue&#8217;<br>&#8216;red&#8217;<br>What is the stack after a pop operation?<br>A.) &#8216;yellow&#8217;<br>&#8216;blue&#8217;<br>&#8216;red&#8217;<br>B.) &#8216;green&#8217;<br>&#8216;yellow&#8217;<br>&#8216;blue&#8217;<br>C.) &#8216;purple&#8217;<br>&#8216;green&#8217;<br>11 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>&#8216;yellow&#8217;<br>&#8216;blue&#8217;<br>&#8216;red&#8217;<br>D.) &#8216;green&#8217;<br>&#8216;yellow&#8217;<br>&#8216;blue&#8217;<br>&#8216;red&#8217;<br>&#8216;purple&#8217;<\/li>\n\n\n\n<li>Which command helps to speed up comparisons us- D<br>ing dictionary keys during a dictionary (d) lookup in<br>this pseudocode clip?<br>h = hash(key)<br>for pair in d:<br>if h == pair[0]:<br>return pair[1]<br>A.) 0(1)<br>B.) pair[0]<br>C.) pair[1]<br>D.) hash(object)<\/li>\n\n\n\n<li>What does the method any(b) return in Python if b is C<br>a dictionary?<br>A.) Returns False if the dictionary is empty.<br>B.) Method any() does not exist for the dictionary.<br>C.) Returns True if any key of the dictionary is true.<br>D.) Returns True if all keys of the dictionary are true.<\/li>\n\n\n\n<li>Which Java method is used to read bytes from a stan- D<br>dard file?<br>A.) Java.mp.In<br>B.) Java.io.StdArrayIO<br>C.) Java.lang.BinaryStdIn<br>D.) Java.io.FileInputStream<\/li>\n\n\n\n<li>A<br>12 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>Which command will retrieve an item from the top of<br>the stack?<br>A.) Pop()<br>B.) Deque()<br>C.) Hash ()<br>D.) Append()<\/li>\n\n\n\n<li>Which command will insert object x at position index C<br>in a list?<br>A.) Get(int index)<br>B.) Remove(int index)<br>C.) Add(int index, Object x)<br>D.) Set(int index, Object x)<\/li>\n\n\n\n<li>Which command will return true if x is in a list, other- C<br>wise return false?<br>A.) IndexOf(Object x)<br>B.) Remove(Object x)<br>C.) Contains(Object x)<br>D.) Set(int index, Object x)<\/li>\n\n\n\n<li>When should a dictionary be used instead of a list? B<br>A.) When the program only uses strings<br>B.) When the program uses key-value pairs as its data<br>C.) When the programmer needs to delete some of its<br>data items<br>D.) When the program needs to quickly modify the<br>contents of its data structures<\/li>\n\n\n\n<li>What is the logical first step in an algorithm that C<br>extracts all the positive values from a given list of<br>numbers?<br>A.) Initialize the result to 0<br>B.) Set the current number to 0<br>C.) Initialize the result to an empty list<br>13 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>D.) Check that the given list contains at least one<br>number<\/li>\n\n\n\n<li>What is displayed when n = 2 in this pseudocode? A<br>for(int i = 2; i &lt;= n; i++){<br>for(j = 0; j &lt;= n;){<br>display j;<br>j = j + n\/2; the division is integer division, decimal part<br>neglected<br>}<br>}<br>A.) 0, 1, 2<br>B.) 1, 0, 2<br>C.) 1, 2, 0<br>D.) 0, 2, 1<\/li>\n\n\n\n<li>Given a set of numeric data and two declared vari- D<br>ables: small and max, what is the logical first step in<br>an algorithm that finds the smallest number?<br>A.) Declaring a variable for small<br>B.) Setting the variable equal to zero<br>C.) Determining the maximum number<br>D.) Checking that the list contains at least one number<\/li>\n\n\n\n<li>What is the logical last step in an algorithm that aver- A<br>ages the high temperatures for 10 days and displays<br>the average high temperature?<br>A.) Printing the temperature<br>B.) Declaring the variable temperature<br>C.) Computing the average high temperature<br>D.) Conditionally accepting the average high temperature<\/li>\n\n\n\n<li>What is the output of the pseudocode below if the B<br>variables declared in the main program are global?<br>14 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>Main<br>Declare X as Integer, Y as Integer<br>Set X = 1<br>Set Y = 2<br>Call Sub(X, Y)<br>Write X<br>Write Y<br>End Program<br>Subprogram Sub(Integer Num1, Integer Num2 as Reference)<br>Declare X as Integer<br>Set Num1 = 3<br>Set Num2 = 4<br>Set X = 5<br>Write X<br>End Subprogram<br>A.) 5<br>34<br>B.) 5<br>14<br>C.) 5<br>32<br>D.) 5<br>24<\/li>\n\n\n\n<li>How many times in this pseudocode is the function F B<br>called?<br>Main<br>Declare K as Integer<br>K = 3<br>Set Result = F(K)<br>Write Result<br>End Program<br>Function F(N) as Integer<br>If N == 1 Then<br>15 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>Set F = 1<br>Else<br>Set F = N * F(N &#8211; 1)<br>Set N = N &#8211; 1<br>End If<br>End Function<br>A.) 1<br>B.) 3<br>C.) 4<br>D.) 6<\/li>\n\n\n\n<li>What is displayed in Step 5 if A = 15 and B = 5 in the D<br>pseudocode below?<br>Step 1: Start<br>Step 2: Read A, B<br>Step 3: C= A*B<br>Step 4: D=A\/B<br>Step5: Print C<br>Step 6: Stop<br>A.) 3<br>B.) 5<br>C.) 15<br>D.) 75<\/li>\n\n\n\n<li>What is displayed in step 3 if midterm = 60 and final = B<br>65 in this pseudocode?<br>Step 1: Declare midterm, final as integer<br>Step 2: average = (midterm+final)\/2<br>Step 3: if (average &lt; 50) then Print &#8220;Fail&#8221; Else Print<br>&#8220;Pass&#8221; endif<br>A.) Fail<br>B.) Pass<br>C.) Average<br>D.) Average = (midterm + final)\/2<br>16 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<\/li>\n\n\n\n<li>How many times will count++ execute when i = 3, in D<br>this pseudocode?<br>int count = 0;<br>int N = 4;<br>for (int i = 0; i &lt; N; i++)<br>for (int j = 0; j &lt; i; j++)<br>count++;<br>A.) 0<br>B.) 1<br>C.) 2<br>D.) 3<\/li>\n\n\n\n<li>At the end of obj, what is the time complexity of insert- A<br>ing in this pseudocode?<br>void DynamicArrayAppend(DynamicArray *obj, const<br>void *input) {<br>if (obj-&gt;logicalSize == obj-&gt;capacity &#8211; 1) {<br>obj-&gt;capacity *= 2;<br>obj-&gt;internalArray = realloc(obj-&gt;internalArray,<br>obj-&gt;capacity * obj-&gt;itemSize);<br>}<br>obj-&gt;logicalSize += 1;<br>DynamicArraySet(obj, obj-&gt;logicalSize &#8211; 1, input);<br>}<br>DynamicArray <em>obj = DynamicArrayCreate(sizeof(int)); for (int i = 0; i &lt; n; i++) { int number = rand() % 10; DynamicArrayAppend(obj, &amp;number); } A.) O(1) or O(n) B.) O(-1) or O(n) C.) O(1) or O(n<\/em>n)<br>D.) O(2) or O(log n)<br>17 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<\/li>\n\n\n\n<li>What is the time complexity of this pseudocode? A<br>double sumCol(double table[][], int numRows, int<br>numCols, int col)<br>{<br>double cSum = 0;<br>for (int row = 0; row &lt; numRows; row++)<br>{<br>cSum += table[row][col];<br>}<br>return cSum;<br>}<br>A.) O(n)<br>B.) O(1)<br>C.) O(n^2)<br>D.) O(log(n))<\/li>\n\n\n\n<li>What is the time complexity of the instructions in this B<br>pseudocode?<br>for (i = 0; i &lt; N; i++) {<br>for (j = i+1; j &lt; N; j++) {<br>\u2026 \/\/ sequence of statements that do not alter N<br>}<br>}<br>A.) O(N)<br>B.) O(N 2)<br>C.) O(log N)<br>D.) O(N log N)<\/li>\n\n\n\n<li>What is the time complexity of this pseudocode? A<br>Algorithm Algo1(A)<br>Input: An array A storing n e 1 integers<br>Output: The sum of the elements in A<br>18 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>s=A[1]<br>for i=1 to n do<br>s=s+A[i]<br>return s<br>A.) O(n)<br>B.) O(1)<br>C.) O(log n)<br>D.) O(n log n)<\/li>\n\n\n\n<li>What is the time complexity of this pseudocode? B<br>Algorithm Algo3(A, B)<br>Input: Arrays A and B, each of them storing ne1 integers<br>Output: Count array B[i], where B[i] equals the sum of<br>A[1] to A[i], i=1 to n<br>c=0<br>for i=1 to n do<br>for j=1 to n do<br>s=A[1]<br>for k=1 to j do<br>s=s+A[k]<br>if B[i]=s then<br>c=c+1<br>return c<br>A.) O(1)<br>B.) O(n 3)<br>C.) O(log n)<br>D.) O(n log n)<\/li>\n\n\n\n<li>What is an attribute of a bubble sort algorithm? B<br>A.) Considered an adaptive sort<br>B.) Ideal for small number of n<br>C.) Fast multiplication algorithm<br>D.) Uses finding the closest pair of points<br>19 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<\/li>\n\n\n\n<li>What is a characteristic of quick sort? C<br>A.) Ability to detect that the list is sorted efficiently<br>B.) Input size is reduced by a constant factor for each<br>step<br>C.) Recursively breaks down a problem into two or<br>more subproblems of the same or related type<br>D.) Finds distances between all pairs of points in a<br>space of dimension d and selects the minimum<\/li>\n\n\n\n<li>Which Big-O notation represents the time complexity D<br>of a bubble sort?<br>A.) O(n)<br>B.) O(n 3\/2)<br>C.) O(log n)<br>D.) \u000b\u000b\u000b\u000b\u000bO(n 2)<\/li>\n\n\n\n<li>What is the typical run time for an insertion sort? C<br>A.) O(n)<br>B.) O(n + k)<br>C.) O(n 2)<br>D.) O(n log n)<\/li>\n\n\n\n<li>A large set of floating point numbers that are in range D<br>from 0.0 to 1.0 and are uniformly distributed across<br>the range need to be sorted.Which sort procedure is<br>useful when the input is uniformly distributed over the<br>range?<br>A.) Radix<br>B.) Shell<br>C.) Bubble<br>D.) Bucket<\/li>\n\n\n\n<li>How many buckets are needed when sorting 13 num- A<br>bers that have 15 digits each, using the radix-sort<br>algorithm?<br>20 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>A.) 10<br>B.) 13<br>C.) 15<br>D.) 28<\/li>\n\n\n\n<li>Four words were added to an initially empty linked D<br>list in the following order: orange, carrot, banana, and<br>apple.Which word is at the beginning of the list?<br>A.) &#8220;apple&#8221;<br>B.) &#8220;banana&#8221;<br>C.) &#8220;carrot&#8221;<br>D.) &#8220;orange&#8221;<\/li>\n\n\n\n<li>Which type of sorting algorithm is demonstrated in C<br>this pseudocode?<br>for i from 0 to N &#8211; 1<br>if a[i] &gt; a[i + 1]<br>swap( a[i], a[i + 1] )<br>end<br>A.) Merge<br>B.) Bucket<br>C.) Bubble<br>D.) Quicksort<\/li>\n\n\n\n<li>Which type of sorting algorithm is demonstrated in D<br>this pseudocode?<br>def shortSort(alist):<br>exchanges = True<br>passnum = len(alist)-1<br>while passnum &gt; 0 and exchanges:<br>exchanges = False<br>for i in range(passnum):<br>if alist[i]&gt;alist[i+1]:<br>exchanges = True<br>temp = alist[i]<br>21 \/ 22<br>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple Choice<br>Study online at https:\/\/quizlet.com\/_935bch<br>alist[i] = alist[i+1]<br>alist[i+1] = temp<br>passnum = passnum-1<br>A.) Merge<br>B.) Radix<br>C.) Quick<br>D.) Bubble<\/li>\n\n\n\n<li>Which type of sorting algorithm is demonstrated in B<br>this code?<br>int partition( void *a, int low, int high )<br>{<br>int left, right;<br>void *pivot_item;<br>pivot_item = a[low];<br>pivot = left = low;<br>right = high;<br>while ( left &lt; right ) { \/* Move left while item &lt; pivot <em>\/ while( a[left] &lt;= pivot_item ) left++; \/<\/em> Move right while item &gt; pivot <em>\/ while( a[right] &gt; pivot_item ) right&#8211;; if ( left &lt; right ) SWAP(a,left,right); } \/<\/em> right is final position for the pivot *\/<br>a[low] = a[right];<br>a[right] = pivot_item;<br>return right;<br>}<br>A.) Radix<br>B.) Quick<br>C.) Merge<br>D.) Bubble<br>22 \/ 22<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>C949 Data Structures and Algorithms PreAssessment &#8211; Multiple ChoiceStudy online at https:\/\/quizlet.com\/_935bch<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[],"tags":[],"class_list":["post-111331","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/111331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=111331"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/111331\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=111331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=111331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=111331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}