Top 10 Questions on Sorting Algorithms and Divide and Conquer Approach Top 10 Questions on Sorting Algorithms and Divide and Conquer Approach Understanding basic sorting algorithms and the divide and conquer approach is crucial for every computer science student. Below are the most frequently asked questions with answers from Module 1: Introduction to Algorithms . 1. What is Selection Sort and how does it work? Selection Sort is a comparison-based algorithm that divides the array into a sorted and unsorted part. It repeatedly selects the minimum element from the unsorted section and moves it to the beginning. Time Complexity: O(n²) Stable: No In-place: Yes 2. What are the steps involved in Insertion Sort? Insertion Sort builds the sorted array one element at a time by inserting each new element into its correct position among the previously sorted elements. Best Case: O(n) Worst Case: O(n²) Stable: Ye...
Algorithm Viva Questions and Answers Algorithm Viva Questions and Detailed Answers 2. Divide and Conquer Approach Q1. What is the Divide and Conquer strategy? It is an algorithmic paradigm that breaks a problem into subproblems, solves them recursively, and then combines their results. Examples include Merge Sort, Quick Sort, and Binary Search. Q2. Explain Finding Minimum and Maximum using Divide and Conquer. The array is split into halves. Recursively, min and max of each half are found, and finally the overall min and max are determined using a comparison of results from the halves. Q3. Describe Merge Sort. Merge Sort divides the list into halves, recursively sorts them, and merges the sorted halves. It has a time complexity of O(n log n) and is stable but not in-place. Q4. Explain Quick Sort. Quick Sort selects a pivot, partitions the array such that elements lesser are on the left and greater on the right, then recursively sort...
Top 8 Linux & Shell Scripting Viva Questions | Computer Engineering Top 20 Viva Questions on Linux & Shell Scripting For Computer Engineering Students - Bharat College of Engineering (Mumbai University) 1. What is the purpose of the forward command in Linux? The forward command typically refers to port forwarding or email forwarding in Linux systems. For network port forwarding, commands like ssh -L or iptables are used to redirect traffic between ports. Email forwarding is configured using .forward files in user directories or through mail server configurations like Postfix. This functionality is crucial for server administration and remote access scenarios. Network administrators use forwarding to expose services securely. Common applications include accessing databases behind firewalls or redirecting web traffic. Always ensure proper authentication when setting up forwarding rules. Security risks like open relay...
Comments
Post a Comment