Answers

    Master this deck with 20 terms through effective study methods.

    Generated from uploaded pdf

    Created by @Kalyan Vejandla

    What are Asymptotic notations?

    Asymptotic notations are mathematical tools used to describe the behavior of functions as they approach a limit, often used in algorithm analysis to characterize the time or space complexity of algorithms. The most common notations are Big O, Theta, and Omega.

    What are the properties of an AVL tree?

    An AVL tree is a self-balancing binary search tree where the difference in heights between the left and right subtrees (balance factor) is at most 1 for all nodes. Properties include: 1) In-order traversal yields sorted elements, 2) Height is logarithmic relative to the number of nodes, and 3) Rotations are used to maintain balance after insertions and deletions.

    What are the best and worst case complexities of Quick sort?

    The best case complexity of Quick sort is O(n log n), which occurs when the pivot divides the array into two equal halves. The worst case complexity is O(n^2), which occurs when the pivot is the smallest or largest element, leading to unbalanced partitions.

    Define Big O notation.

    Big O notation is a mathematical notation used to describe the upper bound of an algorithm's running time or space requirements in terms of the size of the input data. It provides a worst-case scenario for the growth rate of an algorithm.

    What is the purpose of an AVL tree?

    The purpose of an AVL tree is to maintain a balanced binary search tree structure, ensuring that operations such as insertion, deletion, and lookup can be performed in O(log n) time, thus improving efficiency compared to unbalanced trees.

    Define B tree.

    A B tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. It is characterized by nodes that can have multiple children and can store multiple keys.

    What is algorithm analysis?

    Algorithm analysis is the study of the performance and resource usage of algorithms, typically focusing on time complexity and space complexity. It helps in understanding the efficiency of algorithms and in comparing different algorithms for the same problem.

    What is little omega notation?

    Little omega notation (ω) describes a lower bound that is not tight. It indicates that a function grows faster than another function asymptotically, meaning that for sufficiently large inputs, the function will always exceed a constant multiple of the other function.

    What are the properties of a B tree?

    Properties of a B tree include: 1) All leaf nodes are at the same level, 2) Each node can contain a variable number of keys, 3) The keys within a node are sorted, and 4) A node can have a minimum and maximum number of children, ensuring balanced growth.

    How do you identify the space complexity of an algorithm?

    Space complexity is identified by analyzing the amount of memory space required by an algorithm as a function of the input size. It includes both the space needed for the input and the auxiliary space used by the algorithm during execution.

    Explain the deletion operations of elements from an AVL tree.

    Deletion in an AVL tree involves removing a node and then checking the balance factor of the affected nodes. If any node becomes unbalanced, rotations (single or double) are performed to restore balance. The process ensures that the AVL tree properties are maintained.

    What are the types of rotations used to balance an AVL tree?

    The types of rotations used to balance an AVL tree include: 1) Right Rotation, 2) Left Rotation, 3) Left-Right Rotation, and 4) Right-Left Rotation. These rotations adjust the structure of the tree to maintain the balance factor within the allowed range.

    How do you construct a B-tree of order m?

    To construct a B-tree of order m, start with an empty tree and insert keys one by one. Each node can contain up to m-1 keys and m children. When a node exceeds this limit, it splits into two nodes, and the middle key is promoted to the parent node.

    What is time complexity?

    Time complexity is a computational complexity that describes the amount of time an algorithm takes to complete as a function of the length of the input. It is often expressed using Big O notation to provide an upper bound on the running time.

    Identify the time complexity for all four operations on an AVL tree.

    The time complexity for the four main operations on an AVL tree (insertion, deletion, searching, and traversal) is O(log n) due to the tree's balanced nature, which ensures that the height of the tree remains logarithmic relative to the number of nodes.

    What is the significance of Theta notation?

    Theta notation (Θ) provides a tight bound on the growth rate of a function, indicating that a function grows at the same rate as another function asymptotically. It is used to describe both upper and lower bounds, providing a precise characterization of an algorithm's complexity.

    How do you show various stages of an AVL tree during insertions?

    To show various stages of an AVL tree during insertions, you can illustrate the tree after each insertion, highlighting any rotations that occur to maintain balance. This visual representation helps in understanding how the tree structure evolves with each operation.

    What are the similarities and differences between AVL trees and B-trees?

    Similarities include both being self-balancing tree structures that maintain sorted data and allow efficient search operations. Differences include AVL trees being binary trees with strict balance criteria, while B-trees can have multiple keys per node and are optimized for disk storage.

    How do you express a function in Θ notation?

    To express a function in Θ notation, you need to find two functions that bound the original function from above and below, showing that it grows at the same rate. This involves determining constants and ensuring that the function satisfies the definition of Θ.

    What is the process of constructing a B-tree of order 3?

    To construct a B-tree of order 3, start with an empty tree and insert elements in the given order. Each node can have a maximum of 2 keys and 3 children. When a node exceeds this limit, it splits, and the middle key is promoted to the parent node, maintaining the B-tree properties.