



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Answer: Space complexity describes how much additional memory an algorithm requires as input size increases.
25.What is recursion? Answer: Recursion is a technique in which a function calls itself to solve smaller versions of a problem. 26.What is a base case? Answer: A base case is the condition that stops recursive calls. 27.What is sorting? Answer: Sorting is arranging data according to a specified order, such as ascending or descending order. 28.What is bubble sort? Answer: Bubble sort repeatedly compares adjacent elements and swaps them when they are in the wrong order. 29.What is selection sort? Answer: Selection sort repeatedly selects the smallest or largest remaining element and places it in its correct position. 30.What is insertion sort? Answer: Insertion sort builds a sorted portion by inserting each new element into its appropriate position. 31.What is merge sort? Answer: Merge sort divides data into smaller parts, sorts them recursively, and merges the sorted parts. 32.What is quicksort? Answer: Quicksort selects a pivot, partitions data around the pivot, and recursively sorts the resulting subarrays. 33.What is linear search?
Answer: Linear search examines elements sequentially until the target is found or the collection is exhausted. 34.What is binary search? Answer: Binary search repeatedly divides a sorted collection into halves to locate a target efficiently. 35.What requirement does binary search have? Answer: The collection must generally be sorted before binary search is used. 36.What is a tree? Answer: A tree is a hierarchical data structure consisting of nodes connected by edges and organized around a root. 37.What is a binary tree? Answer: A binary tree is a tree in which each node has at most two children. 38.What is a binary search tree? Answer: A binary search tree maintains an ordering in which smaller values are placed to one side and larger values to the other. 39.What is tree traversal? Answer: Tree traversal is the process of visiting every node in a specified order. 40.Name three depth-related tree traversals. Answer: Preorder, inorder, and postorder traversals are common depth-first tree traversals. 41.What is a heap? Answer: A heap is a complete or nearly complete tree satisfying a defined ordering property, such as the min-heap or max-heap property. 42.What is a graph?