Final_exam

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

The speed range of the Bubble Sort is:_______

A. O(n) - O(n2)

Built-in data structures are ____?

B. schemes for storing data that are part of a programming language

What is the level of node K?

C. 5

Describe the ability of Peek operation on the classical Model of a stack

C. The ability to pop a node from the stack without deleting it from the structure

The operation for adding an entry to a stack is traditionally called:

D. push

Two objects, objectA and object, are objects of one class. The objectA is copied to bject. How many objects exist after the copy if the copy is performed as a shallow copy?

A. 1

The doubly linked list is _____

A. A singly list in which each node in the list has an additional linked reference field that refers to the node just before it in the list

A. Access the primary storage area by running preprocessing method B. Assign value of index ip by pseudo key C. Return a copy of the node or a null reference The following are the steps of Direct Hashed Fetch Algorithm____

A. ABC

A.Traverse the list until get the node matched the key B.Set p to refer to the first node in the list C.Return a deep copy of the listing to be fetched or return null if requested node is not on the list Which of the following combination containing steps of the Fetch algorithm of Singly Linked List?

A. BAC

Three criteria are used to determine whether a data structure is acceptable for a particular application are:

A. Cost, Speed and memory overhead

From the information of the array named as data where data = {50, 45, 60, 40, 48, 55, 65} and it is an array-based binary search tree, we build the binary search tree by using the rule "2i+1, 2i+2" where i is the index of the array. Which node will be the child of node B?

A. D and E

ip = h(k) = k mod N = k % N where N is the number of storage location allocated of the primary storage area What is the name of the function?

A. Division Hashing Function

Comparing Sequential Search algorithm, the hashing algorithms are ____

A. Fast

The following is operation of the singly linked list ____

A. Fetch, Insert, Delete, Update

Direct Hashed Algorithm has the following operations:

A. Insert, Fetch, Delete, Update

The basic operations performed on data structures:

A. Insert, delete, fetch, update

Which one is not correct for the speeds of Sorted Array Structure operations

A. Insert: O(3)

What is incorrect about Nonperfect Hashed Structures?

A. Nonperfect Hashed structures are structures that provide a unique location in the primary storage area for every allowable value of the key

The average speed of Direct Hashed Data Structure is

A. O(1)

The speed of LQHashed is ___

A. O(1)

The Binary Search algorithm speed at the worst case is:

A. O(log2n)

Which type of error that occurs if a Push operation is invoked on a full stack?

A. Overflow error

Given an empty Queue Q, what does it look like after the following operations? Q.enqueue(5); Q.enqueue(2); Q.dequeue(); Q.enqueue(3); Q.dequeue();

A. Queue Q stores 3

Tell what of the following does the acronyms LIFO describes for:

A. Stack

The linked list structure is ____

A. The data structure that can rapidly expand to accommodate a virtually unlimited number of nodes, one node at a time

Binary Tree Sort is ____

A. The process that uses the inserting nodes into a binary search tree algorithm to put all items into order.

Which of the following operation cannot be used to access restricted structures?

A. Update

To set up the table for a party, if we use n tables and set up one next another as the picture. How many seats are there when if one side of the table can place only one chair? When determine Four-Step Methodology for developing recursive algorithm to write a recursive function named as calculateSeat(int n) What is the reduce problem?

A. calculateSeat(n-1)

Hashing access function ip = h(k). Which one of the following is NOT correct

A. it is used to compute the max size of the primary storage area

If we apply the recursion algorithm to write the function totalBricks(int n). What is the base case?

A. n = 1; totalBricks(1) = 1

Which node is the root of the tree?

A. node A

NRL Traversal is called ___

A. preorder scan

There is a series of numbers as follows: 0, 1, 2, 4, 8, 16, 32, 64, ...... To prepare the recursion algorithm to write the method named "valueAt" to tell the value of the number at n What is the reduce problem?

A. valueAt (n-1)

The method names of Java LinkedList class are:

Add, get, remove, set

The base case; reduce problem and general solution of the recursive algorithm of n! are:

B. 0! = 1 (n-1)! n(n-1)!

Recall that the linear list access function: AN = A0 + N * w that is used to calculate the location of an element of the array from its node number where Ao is the byte address of the first node called the base address w is the node width (number of bytes per node) and N is node number, starting from 0 Apply this function to calculate the memory address of the node stored at index 4 where base address = 100, node width = 10

B. 140

The outdegree of node B is:

B. 2

Two objects, objectA and objectB, are objects of one class. The objectA is copied to objectB. How many objects exist after the copy if the copy is performed as a deep copy?(PAGE 41)

B. 2

The menu of Juan's Taco Tower states "when ordering a Sombrero Meal you get a taco, and a soda, and your choice of an ice cream sundae or a Sombrero Meal" Which of the following is the acceptable order?

B. 2 taco, 2 soda and 1 ice cream sundae

I am going to execute this code with THREE pushes and ONE pop: stack <int> s; s.push(1); s.push(2); s.push(3); System.out.println(s.pop( )); What is the output?

B. 3

How many levels does the tree have?

B. 6

The Double Ended Singly Linked list is _____

B. A singly linked list in which in which insertions are permitted at the front and rear of the list

A. Set the trailing reference Node q to refer to the dummy node B. Set Node p pointing to the first linked node (after the dummy node) C. Traverse the list until get the node matched the key, make q trail p throughout the traverse D. If node p is not null, jump over the delete node then return true, if it is null, return false Which of the following combination containing steps of the Delete algorithm of Singly Linked List?

B. ABCD

A. Access the primary storage area by running preprocessing method B. Delete the node at ip C. Assign value of index ip by pseudo key The following are steps of Direct Hashed Delete Algorithm ___

B. ACB

The Delete algorithm of Sorted Array Structure has the following steps, put them in correct order (page 74) Step A: next = next-1 and assign data[next] to null (reclaim unused storage) Step B:Use Binary Search algorithm to locate the node i to be deleted Step C: Move all the references below node i to node next-2 up one index

B. BCA

Which one is not correct for the speeds of Unsorted Array Structure operations

B. Delete: O(log2n)

They are the operations that perform on the Queue structures

B. Enqueue, Dequeue

The programmer-defined array structures support the following operations

B. Fetch, Insert, Delete, Update

Red-Black Tree is a self-balancing binary search tree, each node must be red or black. Which one is NOT correct for the Red -Black Tree

B. If a node is black its children must be red

Which one is true for Linear List?

B. It is a collection of n nodes if there is a unique first node N1, unique last node Nn and for any other node, only one node comes before it and only one node comes after it

The speed of singly linked list fetch algorithm is ____

B. O(n)

The speed range of the Binary Tree Sort is: ____

B. O(nlog2n) - O(n2)

The speed range of the Quick Sort is _____

B. O(nlog2n) - O(n2)

They are the operations that perform on the Stack structures

B. Pop, push

Tell what of the following does the acronyms FIFO describes for:

B. Queue

A = 23n + 36n2 B = 6 + nlog2(n) + n C = log2n + 36n2 Which one of the following is correct?

B. TA = O(n2) TB = O(nlog2(n)) TC = O(n2)

Suppose in the main(), we define a Singly Linked List with Iterator: SinglyLInkedListIterator theList = new SinglyLinkedListIterator(); theList.insert(node1); theList.insert(node2); where is the location of Iterator i?

B. The iterator i is at h

The process of moving from the first node to the second node to the third node, etc. by using the contents of the link fields to locate the next node is called _____

B. Traversing

Which type of error that occurs if a Pop operation is invoked on an empty stack?

B. Underflow error

Procedural abstraction is

B. We do not need to know the implementation details of the method in order to use it

At a party, they have the tables that have the shape with 6 sides, each side has one seat. If they connect these tables, one next others, we have these table set up as the above picture. If we apply the recursion to write the Java method named calculateSeat(n), what is the general solution?

B. calculateSeat(n-1) + 4

LNR Traversal is called _____

B. inorder scan

If we apply the recursion algorithm to write the function totalBricks(int n) What is the general solution?

B. n + totalBricks(n-1)

To set up the table for a party, if we use n tables and set up one next another as the picture. How many seats are there when if one side of the table can place only one chair? When determine Four-Step Methodology for developing recursive algorithm to write a recursive function named as calculateSeat(int n) what is the base case for this problem?

B. n = 1; seat=4

Maximum number of nodes (nLmax) in a binary tree with L levels is ___

B. nLmax = 2L -1

Which of the following stack operations could result in stack underflow?

B. pop

What is the reason for using a "circular queue" instead of a regular one?

B. reuse empty spaces

The Delete algorithm of Unsorted Array Structure has the following steps, put them in correct order (page 67) Step A: Set the array element that stores the reference to the node to null Step B:Use sequential search to locate the node to be deleted, the search begins at element zero and terminates when the node with the given key is located. Step C: Move all the node references below the deleted node up one element in the array and then decrement the memory cell next

BCA

There are several types of linked lists but all of them share two common characteristics. Which two of the following are the correct common characteristics: 1.Every node in the sturcture has at least one field, called a link field, that stores the location of another node (with the exception of the unique last node,, if there is one) 2.Every node in the structure has at least one field, called index that stores the location of the node on the structure. 3.Each node in the structure has at least one field, called size that stores the length of the list. 4.Each node's location is sotred in at least one other node (with the exception of the unique first ndoe, if there is one)

C. 1 and 4

Give a 5 elements stack S (from top to bottom: 2, 4,6,8,10 ) and an empty queue Q. Remove the elements one by one from the stack S then insert them into queue Q; then remove them one by one from queue Q and re-insert to the stack S. Now S looks like (from top to bottom):

C. 10, 8, 6, 4, 2

int[ ] values = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 }; Stack s = new Stack(10); for (int i = 0; i < 10; i ++) s.push(values[ i ]); int sum = 10; for (int n = 0; n <3; n++) sum = sum + s.pop(); System.out.println (sum); What is the output?

C. 61

A. Create a new linked list Node object B. Place the address of the new linked list Node object into the next field of the dummy node (h. next) C. Add the new linked list Node object to the beginning of the linked list D. Deep copy the client's information, reference the copy Which following combination are steps of the Insert Algorithm of the Singly Linked List data structure?

C. ACBD

1. Fetch algorithm of Unsorted Array Structure with the key targetKey has the following steps, put them in correct order (page 69-70) Step A: return a deep copy of it Step B: Use Sequential Search Algorithm starting at element 0 and down the ar ray until an object with the given key is found (page 71)

C. BA

Fetch algorithm of Sorted Array Structure with the key targetKey has the following steps, put them in correct order (page 69-70) Step A: return a deep copy of it Step B: Use Binary Search algorithm starting to locate the node

C. BA

Fetch algorithm of Unsorted -Optimized Array Structure with the key targetKey has the following steps, put them in correct order (page 79 - 80) Step A: return a deep copy of it Step B: Use Sequential Search Algorithm starting at element 0 and down the array until an object with the given key is found Step C: Move the node reference up one index in the array unless the node being fetched is reference by element at zero

C. BCA

The Insert algorithm of Unsorted Array Structure has the following steps, put the following steps in correct order (page 66) Step A: index next is incremented by one to prepare for the next insert Step B: A new node object is allocated with its contents initialized to the contents of the node to be inserted Step C: A reference to it is placed into the array at data[next]

C. BCA

The following is not true about Binary Search :

C. Binary Search algorithm can be applied on the unsorted arrays

From the information of the array named as data where data = { 100,250, 260, 300, 320, 340, 360} If it is an array-based binary search tree, we build the binary search tree by using the rule "2i+1, 2i+2" where i is the index of the array. Based on the information of nodes'addresses, which node will be childen of node D?

C. C and F

The menu of Juan's Taco Tower states "when ordering a Sombrero Meal you get a taco, and a soda, and your choice of an ice cream sundae or a Sombrero Meal" What is the base case (escape clause) in the description of a Sombrero Meal?

C. Choice of an ice cream

Which one is NOT correct for collision and collision algorithm?

C. Collision algorithms increase the speed of access

Mergesort makes two recursive calls. Which statement is true after these recursive calls finish, but before the merge step?

C. Elements in the first half of the array are less than or equal to elements in the second half of the array.

Basic operations that are supported by built-in structure array support are (page 63)

C. Fetch and Update

Which one is not correct for the speeds of Unsorted-Optimized Array Structure operations?

C. Fetch: O(log2n)

Put the terms, node, field and data set in size order from small to large: (page 11-12)

C. Field, node, data set

Which one is not correct about the object (page 40)?

C. In Java, accessing information in objects requires only one memory access as primitive variable (page 40)

Which of the four basic operations do the restricted structures support?

C. Insert

Which statement is NOT correct for Built-in Structure Array: (page 60)

C. It can grow and shrink, therefore, Insert and Delete operation would be allowed

Nodes A, B and C are placed on a stack in the order first A, then B and finally C, if invoking pop method on this stack, which node will be popped

C. Node C

The speed of Dequeue operation of Queue structure is:

C. O(1)

The speed of Enqueue operation of Queue structure is:

C. O(1)

The speed of Pop operation of Stack structure is:

C. O(1)

The speed of Push operation of Stack structure is:

C. O(1)

What is the worst-case time for heap sort to sort an array of n elements?

C. O(n log n)

What is the worst-case time for mergesort to sort an array of n elements?

C. O(n log n)

The speed range of Heap Sort is ______

C. O(nlog2n) - O(nlog2n)

Which statement is not correct about data?

C. Studies show that programs spend only 10% of their execution time for searching through memory to locate the data they process

Heap sort is ______

C. The algorithm executes its sorting process has several steps. First step, place all the items to a binary tree by using the rule 2i+1 and 2i+2, then built the initial heap, Finally, repeatedly swap the root (greatest number) to its proper location and re-build the remaining items into the heap

Which one is not correct about Inheritance?

C. The classA is called the parent class and the classB is called the child class

Which one is NOT correct for sorting?

C. The process of putting a set of item in shortest length

Which is NOT correct for the Linked list data Structure?

C. There are more than one first nodes

Class abstraction is:

C. We do not need to know the implementation details of a data structure in order to use it

Generic Data Structure is: (page 106)

C. a and b

Preprocessing algorithm is:____

C. a and b

The factors determine the cost of software are: (page 10)

C. a and b

The purpose of sorting the set of data structure is _____

C. a and b

Which one is correct method names of ArrayList (page119)?

C. add, get, remove and set

There is a sequence of letter a, b and c as follows: acbacbacb... If we know the sequence n-1 letters, we can write the letter at location n easily. What are the letters at location 117 118 and 119?

C. bac

There is a series of numbers as follows: 0, 1, 2, 4, 8, 16, 32, 64, ...... To prepare the recursion algorithm to write the method named "valueAt" to tell the value of the number at n position. What is the base case?

C. both a and b

To set up the table for a party, if we use n tables and set up one next another as the picture. How many seats are there when if one side of the table can place only one chair? When determine Four-Step Methodology for developing recursive algorithm to write a recursive function named as calculateSeat(int n) What is the general solution?

C. calculateSeat(n-1) + 2

For convenience of typing, the Java code replaces the subscript with the index for an array n elements. which one is NOT correct about it (page 63)

C. index i ends by n

Which one is correct about array?

C. int [ ] myInt = new int[3];

Which node(s) is/are the child/children of the node B?

C. node D and node E

The node has the highest level is: ____

C. node K

The operation for removing an entry from a stack is traditionally called:

C. pop

RLN Traversal is called ____

C. postorder scan

What does the method "public void set (Node newNode)" of the class Iterator do to the SinglyLinkedListIterator structure?

C. replace the node stored ad the iterator's current position with a cone of newNode and the iterator's position is not changed

onsider the following pseudocode: declare a stack of characters while ( there are more characters in the word to read ) { read a character push the character on the stack } while ( the stack is not empty ) { write the stack's top character to the screen pop a character off the stack } What is written to the screen for the input "carpets"?

C. steprac

Assume 16 lines of code per person per day. Estimate a program will consist of 300,000 lines of code. If the burdened cost of a programmer's efforts is $150 per hour, determine the code of the program (page 10)

D. 22.5 million dollars

The outdegree of the tree is:

D. 3

The sorted singly linked list is _____

D. A singly linked list in which the nodes are positioned in the list in sorted order based on the contents of their key field.

Array element of the Built-in Structure array: (page 60-61)

D. All of above

Big-O analysis is __________

D. All of above

Pseudo key is____

D. All of above

Which one is the programmer-defined array structure? (page 66)

D. All of above

Unsorted array is array-based structure that ____ (page 66)

D. All of above are correct

Which is NOT correct for the singly linked list?

D. Any other node nk can be proceeded by more than one node

The menu of Juan's Taco Tower states "when ordering a Sombrero Meal you get a taco, and a soda, and your choice of an ice cream sundae or a Sombrero Meal" What is the part of the Sombrero Meal's description is recursive?

D. Choice of a Sombrero Meal

Which one is not correct about the class?

D. Class is one of primitive data type that Java defines in Java library

Update algorithm of Unsorted Array Structure with the key field as targeKey will combine two following operation in this order (page 71)

D. Delete - Insert

Which one is not correct about encapsulation?

D. Encapsulation provides the code such that all the fields can be access from everywhere outside the class

It is not correct for Recursive algorithm

D. Every problem can be formulated it into recursive algorithm

Which one is NOT correct about ArrayList (page 118)?

D. Insert, Fetch, Delete, and Update are 4 method names of ArrayList

Which one is NOT correct for the directed or general tree structure?

D. It has the fixed size, cannot expand

Which one is NOT correct for a Binary tree?

D. It has the max number of level is two

Which one is NOT correct for AVL

D. It is the notation of Automatic Varied Level

The attribute of the tree structure makes it attractive in certain application is _____

D. It is the structure can easily model data in a hierarchical form

The most fundamental category of noncontiguous data structure is

D. Linked List

Which one is NOT correct with Hashing access algorithms

D. The Hashing access algorithm uses the node number to access data structure

The Merge Sort is _____

D. The algorithm executes its sorting process based on the idea that two sorted sublists A and B can be merged into one sorted list T by comparing the minimum items in each sublist, the smaller of two items is transferred to the list T. This process is continued until either sublist A or B is empty, then the remaining items from the nonempty sublist are transferred to T

Algorithm speed will consider the following factors:

D. a and b

It is a type of the Restricted structures:

D. a and c

There are 2 nodes are stored in a linear list. What node comes just before and just after the first node?

D. a and c

LQHashed has the following operation(s):

D. all of above

The pseudo key is computed from the Subtraction Preprocessing algorithm is____

D. all of above

A binary search tree is a binary tree and ___

D. all of above are correct

Visiting a node on a tree means:___ (Choose the best answer)

D. all of the above

There is a series of numbers as follows: 0, 1, 6, 11, 16, 21, 26, 31, ...... To prepare the recursion algorithm to write the method named "valueAt" to tell the value of the number at n position, What is the base case?

D. both b and c

1. for (int n=0; n<10; n++) { for (int m=0;m<10; m++) { if (item[m] > item[n] ) { temp = item[m]; item[m] = item[n]; item[n] = temp; } } } What is the sort effort (SE) the above algorithm?

D. m2

The following is the list of features that the sorting algorithm analysis techniques need to know, which one is NOT correct:

D. none of above

The Quick Sort is _____

E. The algorithm executes its sorting process by choosing an item called pivot value and at the end of each pass the items is positioned into its proper sorted place in the array, then partitioning the array into two parts and continue to sort recursively until the array sorted.

A Heap is a binary tree in which the value of each parent in the tree is smaller than both of its children's values

False

A real-world example of the queue data structure can be seen in the cafeteria trays, where the last tray placed onto is the first tray removed.

False

A stack will be initialized with top = 0 and data[i] = null with i = 0 to size

False

All algorithms can be stated recursively

False

An array data structure full can grow when inserting a new node or shrink when deleting a node.

False

Balancing a binary tree is the process to maximize the number of levels in the tree

False

For any heap, the smallest node in the heap is the root node and all subtrees in a heap are themselves heaps

False

In the bubble sort algorithm, one pass will place all items into the final position in the array

False

In the circular singly linked list, one node can move to the node before it by using the field previous that point to the previous node

False

In the doubly linked list data structure, there is only one way to move from one node to the node after it by using the field next, cannot go back to the node before it.

False

In the queue structure, the node is inserted at front and is removed at rear

False

LQHashed Data Structure has the key that has to be a integer number.

False

Non-perfect hashing algorithm is an algorithm that provides a unique location in the primary storage area for each key

False

The algorithm of Insert operation of the Sorted Singly Linked List is after inserting a node after dummy node then the linked list will sort the list to place the node at the right location.

False

The hashing accesses function ip = h(k) is the Division hasing function that is used to compute a location into the primary storage area

False

The last node in a singly linked list, by definition, it store the address of a node on the list

False

The pop function in the stack retrieve the value from the top of the stack. It does not removes it.

False

The queue is initialized with the top = -1 and data[ i ] = null where i = 0 to size

False

The singly linked list has the header node and the rear node

False

The size of the Primary Storage Area, N, for a Hashed Structure is N = nmax + p * nmax Where nmax is the maximum number of nodes to be stored in the structure and p could be a prime number or a percentage expressed in a decimal form

False

public void message() { System.out.println("This is a message"); message(); } The above method message is an example of direct recursion since it calls itself directly

False

push 5 numbers on to the stack in this order 1 2 3 4 5, then pop each of them to enqueue to a queue. After that dequeue them from the queue and push them back to stack. The in the stack we have this 1 2 3 4 5 where 5 is at the top

False

Which one is NOT correct for the balance factor of each node in AVL tree

If it is 1, 0 or -1, then the tree need to be rebalanced

A perfect hashed structures are the structures that based on perfect hashing algorithm and are the fastest of all the data structures we studied

True

All recursive algorithms must have an escape clause

True

All the array-based structures access nodes by using the key field mode

True

All the nodes of an array data structure are located on contiguous memory address. Therefore, the nodes are stored sequentially based on the node number.

True

An iterator that is defined with the Singly Linked List is an object that the client can use to sequentially access the nodes in a linear list. The iterator i provides methods to operate on the node at the iterator's current position

True

Balanced tree is a tree that has all the levels below the highest level are fully populated

True

Enqueue each letter of the word "Welcome" to the queue then print out the result of dequeue each letter from the queue will get the same word "Welcome

True

Fold Shifting Preprocessing Algorithm divides the key field into groups of bits, with the size of each group being the desired size of the pseudo

True

For the Binary Tree Sort algorithm, the speed is dependent upon how well the binary tree is balanced

True

In the non-perfect hashed structure, the search length is the number of memory access required to located the node

True

Iterator class provides methods for positioning the iterator object at the first item in the list

True

Iterator is an object that the client can use to sequentially access the ndoes in a linear list

True

Pseudorandom Average Preprocessing is a technique used to distribute keys somewhat randomly about the primary storage area array

True

Reverse a String s of length n can be written by using recursive algorithm

True

The Merge Sort is based on the idea that two sorted sublists, A and B, can be merged into one sorted list, T, by comparing the minimum items in each sublist. The smaller of the two items is transferred to list T. This process is continued until either sublist A or B is empty, then the remaining items from the nonempty sublist are transfered to T

True

The binary search tree object is initialized with the root node is null

True

The built-in data structure array supports the key field access mode

True

The first item placed onto a stack is always the last item removed from the stack

True

The iterator object is used in the linear list such that the object retains its position in the list after an operation is performed. This will help to speed up the update process of the list by n times

True

The linear list access function: AN = A0 + N * w that is used to calculate the location of an element of the array from its node number where Ao is the byte address of the first node called the base address w is the node width (number of bytes per node) and N is the number of the node, starting from 0

True

The merge sort is based on the idea that two sorted sublists, A and B, can be merged into one sorted list T by comparing the minimum items in each sublist to transfer to T until one sublist empty then the remaining items on other sublist will be transfered to T

True

The recursive methods often call themselves at many times and each time it calls a lower level of recursion, a new stack frame is built. Therefore, recursive method runs slowly and consumes memory. At the worst case, the programs that invoke recursive methods run unacceptably slowly can terminate in a run-time "Stack Overflow" error.

True

The speed of the Insert and Fetch algorithm of a binary search tree structure is between O(log2 n) and O(n) depending on how the tree is balanced

True

There are two common techniques used to implement an iterator class. One technique defines the class inside the data structure class and the iterator object is a public data member of the data structure class other technique defines the class outside the data structure class and iterator object is declared in the client code

True

We can Insert a node to the front or the rear of the double ended singly linked list data structure

True

With Quicksort algorithm, during each pass, the data item in the middle of the unsorted array is chosen to be a pivot value. The other items in the array will be positioned such that the values of the items to the left of the pivot value are all less than it and the values to the right of the pivot are all greater than it.

True

Working with built-in array data structure, Insert and Delete operations cannot be allowed

True

Data Structure is ____

a and b

1. The Insert algorithm of Sorted Array Structure has the following steps, put the following steps in correct order (page 76) Step A: Using Binary Search Algorithm to search until finding two adjacent keys that backed the new node's key Step B: Move all the nodes below these two nodes and the larger of the two braked nodes down one element to open up a spot for the new node Step C: The content of the node that we want to insert is deep copied to the spot for the new created node then a reference to that node is placed in the array element that has been opened up

a.ABC

There is a sequence of shapes as below: rectangle, triangle, circle, rectangle, etc. Write the code to draw the sequence of n shapes. To solve this problem we apply Four-Step methodology for develop Recursive algorithm as follows: Base case: n=0 then we have nothing Reduced problem: shapeAt(n-1) draws the sequence of n-1 shapes What is the condition of the following general solution?

c. Depend on the value of n %3

In the implementations of the Stack operation presented in this chapter, what does the memory cell top store?

d. the index of the array where the last push or the next pop is performed

There are two Access Modes that are used to specify the node to be accessed:

e. a and c


Set pelajaran terkait

Chapter 8: Intellectual Property Rights

View Set

CIS 388 Exam 3 Practice Questions

View Set

Exam 1: Medication Administration and Safety Questions

View Set

Abeka Investigating God's World chapter 2

View Set

Handout 10: Integrative Metabolism

View Set