IT245_Final_Review.pdf.pdf
Document Details
Uploaded by StatelyKoala1970
2021
Tags
Full Transcript
ر الجامعة السعودية االلكتونية ر االلكتونية الجامعة السعودية 26/12/2021 College of Computing and Informatics IT245 Data Structure IT245 – Final Review …….... is the technique that uses key to find or store an item in a data structure. a) Graph b) Tree c) Hashing d)...
ر الجامعة السعودية االلكتونية ر االلكتونية الجامعة السعودية 26/12/2021 College of Computing and Informatics IT245 Data Structure IT245 – Final Review …….... is the technique that uses key to find or store an item in a data structure. a) Graph b) Tree c) Hashing d) Stack …….... is the technique that uses key to find or store an item in a data structure. a) Graph b) Tree c) Hashing d) Stack The process of arranging a group of items into a defined order based on a particular criteria. This is called: a) Hashing b) Sorting c) Storing d) Pushing The process of arranging a group of items into a defined order based on a particular criteria. This is called: a) Hashing b) Sorting c) Storing d) Pushing Similar to trees, consist of nodes and the connections between those nodes. a) Graph b) Queue c) Hashing d) Stack Similar to trees, consist of nodes and the connections between those nodes. a) Graph b) Queue c) Hashing d) Stack When an element is inserted, it hashes to the same value as an already inserted element. This problem called: a) Probing b) Collision c) Hashing d) Chaining When an element is inserted, it hashes to the same value as an already inserted element. This problem called: a) Probing b) Collision c) Hashing d) Chaining …………… orders values by partitioning the list around one element, then sorting each partition. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort …………… orders values by partitioning the list around one element, then sorting each partition. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort In Quick Sorting, selecting the first value as a pivot is acceptable if the input is: a) Descending ordered b) Ascending ordered c) Fixed d) Random In Quick Sorting, selecting the first value as a pivot is acceptable if the input is: a) Descending ordered b) Ascending ordered c) Fixed d) Random ……… is a path in which the first and last vertices are the same and none of the edges are repeated. a) Undirected graph. b) Weighted graph. c) Cycle directed graph. d) Acyclic directed graph. ……… is a path in which the first and last vertices are the same and none of the edges are repeated. a) Undirected graph. b) Weighted graph. c) Cycle directed graph. d) Acyclic directed graph. Which type of graph that the pair is not ordered: a) Directed graph. b) Weighted graph. c) Undirected graph. Which type of graph that the pair is not ordered: a) Directed graph. b) Weighted graph. c) Undirected graph. In direct graph, If there is a path from every vertex to every other vertex, called: a) Connected. b) Strongly connected. c) Completed. d) Strongly completed. In direct graph, If there is a path from every vertex to every other vertex, called: a) Connected. b) Strongly connected. c) Completed. d) Strongly completed. Which of the sorting algorithms that uses a sequence called the increment sequence (h1 , h2 ,... ht ). a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort Which of the sorting algorithms that uses a sequence called the increment sequence (h1 , h2 ,... ht ). a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort An edge (v, v) of a graph that connects a vertex to itself is called a a) Complete. b) Connect. c) Vertex d) Loop. An edge (v, v) of a graph that connects a vertex to itself is called a a) Complete. b) Connect. c) Vertex d) Loop. A graph that has an edge between every pair of vertices is called: a) Complete. b) Uncompleted. c) Strongly completed. A graph that has an edge between every pair of vertices is called: a) Complete. b) Uncompleted. c) Strongly completed. What are the steps of external algorithm example using Merge sort? What are the steps of external algorithm example using Merge sort? Step 1: Read the input data from the file and input it as data sets of size of memory. Step 2: For each of these mini data sets sorted each of them using merge sort. Step 3: Store the sorted data into a file. Step 4: Merge each of the sorted data file. In the tree, the top node called: a) Root b) Child c) Parent d) Siblings In the tree, the top node called: a) Root b) Child c) Parent d) Siblings In BST, Traverse strategy with order (left, right, node) is: a) Preorder traversal. b) Postorder traversal. c) Inorder traversal. In BST, Traverse strategy with order (left, right, node) is: a) Preorder traversal. b) Postorder traversal. c) Inorder traversal. In linked list each node contains a minimum of two fields. One field is data field to store the data second field is? a) Pointer to character b) Pointer to integer c) Pointer to node d) Node In linked list each node contains a minimum of two fields. One field is data field to store the data second field is? a) Pointer to character b) Pointer to integer c) Pointer to node d) Node Which of the following is the fast sorting algorithm in practice. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort Which of the following is the fast sorting algorithm in practice. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort The following code is for which sorting algorithm? a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort The following code is for which sorting algorithm? a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as: a) Tree b) Stack c) Queue d) Linked list A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as: a) Tree b) Stack c) Queue d) Linked list The worst case running time of Mergesort is: a) O(N2) b) O(N2/3) c) O(N log N) d) O(log N). The worst case running time of Mergesort is: a) O(N2) b) O(N2/3) c) O(N log N) d) O(log N). It sorts a list of items by repeatedly inserting a new element into a sorted sublist. The process continue until the whole list is sorted. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort It sorts a list of items by repeatedly inserting a new element into a sorted sublist. The process continue until the whole list is sorted. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort A Queue follows a) LIFO (Last In First Out) principle b) FIFO (First In First Out) principle c) Ordered Array d) Binary Tree A Queue follows a) LIFO (Last In First Out) principle b) FIFO (First In First Out) principle c) Ordered Array d) Binary Tree Worst case running time of Shellsort using Shell’s increments = a) O(N2) b) O(N2/3) c) O(N log N) d) O(log N). Worst case running time of Shellsort using Shell’s increments = a) O(N2) b) O(N2/3) c) O(N log N) d) O(log N). ………... orders values by recursively dividing the list in half. The recursion stops when each sub list has one element, then recombining. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort ………... orders values by recursively dividing the list in half. The recursion stops when each sub list has one element, then recombining. a) Insertion Sort b) Shellsort Sort c) Heap Sort d) Quick Sort e) Merge Sort Which of the following algorithms is an example of Greedy algorithm? a) Dijkstra’s algorithm. b) Merge Sort. c) Quick Sort. Which of the following algorithms is an example of Greedy algorithm? a) Dijkstra’s algorithm. b) Merge Sort. c) Quick Sort. Which of the following algorithms is an example of Divide and Conquer algorithms? a) Insertion Sort b) Shellsort Sort c) Merge Sort Which of the following algorithms is an example of Divide and Conquer algorithms? a) Insertion Sort b) Shellsort Sort c) Merge Sort When a collision occurs, sequentially search the table until an empty location is found. This solution known as: a) Linear Probing b) Quadratic Probing c) Double Hashing d) Separate Chaining When a collision occurs, sequentially search the table until an empty location is found. This solution known as: a) Linear Probing b) Quadratic Probing c) Double Hashing d) Separate Chaining In the stack, insert item called: a) Enqueue. b) Dequeue. c) Push. d) Pop. In the stack, insert item called: a) Enqueue. b) Dequeue. c) Push. d) Pop. In Queue data structure, Dequeue is: a) Delete the element at the middle of the list. b) Delete the element at the end of the list. c) Delete the element at the front of the list. In Queue data structure, Dequeue is: a) Delete the element at the middle of the list. b) Delete the element at the end of the list. c) Delete the element at the front of the list. When the result of the hash function results in a collision, a second hash function is used. This solution known as: a) Linear Probing b) Quadratic Probing c) Double Hashing d) Separate Chaining When the result of the hash function results in a collision, a second hash function is used. This solution known as: a) Linear Probing b) Quadratic Probing c) Double Hashing d) Separate Chaining In the stack, insert and delete can be performed in only one position, called: a) Top b) Pop c) Push d) List In the stack, insert and delete can be performed in only one position, called: a) Top b) Pop c) Push d) List When the table size of hash table becomes gets too full, we need to do: a) Rehashing. b) Double Hashing. c) Separate Chaining. d) Collision. When the table size of hash table becomes gets too full, we need to do: a) Rehashing. b) Double Hashing. c) Separate Chaining. d) Collision. Which of following is true about separate chaining ? a) Improve the algorithm speed. b) Slow down the algorithm speed. c) Simple approach. Which of following is true about separate chaining ? a) Improve the algorithm speed. b) Slow down the algorithm speed. c) Simple approach. What is the type of the following Tree: a) Min Heap. b) Max Heap. c) Not a heap. What is the type of the following Tree: a) Min Heap. b) Max Heap. c) Not a heap. The ………. data structure is very suitable for implementing priority queues. a) Stack. b) Linked List. c) Graph. d) Binary Heap. The ………. data structure is very suitable for implementing priority queues. a) Stack. b) Linked List. c) Graph. d) Binary Heap. What is the goal of Dijkstra’s algorithm? What is the goal of Dijkstra’s algorithm? The algorithm finds the shortest path from an initial vertex, say v, to all the other vertices in the graph. Which of the following is true about the below Figure: a) Min Heap. b) Max a heap. c) Complete Tree d) Not a complete Tree Which of the following is true about the below Figure: a) Min Heap. b) Max a heap. c) Complete Tree d) Not a complete Tree ………. is a tree formed from graph edges that connects all the vertices of G at lowest total cost. a) Dijkstra’s Algorithm. b) Breadth-first search c) Depth-first search d) Minimum Spanning Tree ………. is a tree formed from graph edges that connects all the vertices of G at lowest total cost. a) Dijkstra’s Algorithm. b) Breadth-first search c) Depth-first search d) Minimum Spanning Tree The following code is for which algorithm? a) Dijkstra’s Algorithm. b) Breadth-first search c) Depth-first search d) Minimum Spanning Tree The following code is for which algorithm? a) Dijkstra’s Algorithm. b) Breadth-first search c) Depth-first search d) Minimum Spanning Tree Sort using all the sorting algorithms we learned: [ 4 , 5 , 7 , 1 , 11 , 9 ] Insertion Sort [ 4 , 5 , 7 , 1 , 11 , 9 ] Insertion Sort [ 4 , 5 , 7 , 1 , 11 , 9 ] [ 4 | 5 , 7 , 1 , 11 , 9 ] [ 4 , 5 | 7 , 1 , 11 , 9 ] [ 4 , 5 , 7 | 1 , 11 , 9 ] [ 1, 4 , 5 , 7 | 11 , 9 ] [ 1, 4 , 5 , 7 , 11 | 9 ] [ 1, 4 , 5 , 7 , 9 , 11 ] Sorted Shellsort: increment sequence: [3,2,1] Shellsort: increment sequence: [3,2,1] [ 4 , 5 , 7 , 1 , 11 , 9 ] [ 1 , 5 , 7 , 4 , 11 , 9 ] [ 1 , 4 , 7 , 5 , 11 , 9 ] [ 1 , 4 , 5 , 7 , 11 , 9 ] [ 1 , 4 , 5 , 7 , 9 , 11 ] Heapsort [ 4 , 5 , 7 , 1 , 11 , 9 ] Heapsort Heapsort Mergesort Quicksort Thank You