Algorithm Question Bank PDF
Document Details

Uploaded by ConstructiveSard2813
Parul Institute of Engineering and Technology
Tags
Related
- Data Structures & Algorithms Lecture Notes 1 PDF
- Data Structures and Algorithms with JavaScript PDF
- Data Structures & Algorithms - Topic 15 - Selection, Insertion, Bubble & Shell Sort - Lecture Slides
- Data Structures and Algorithms with Python and C++ PDF
- Data Types and Structures
- Introduction to Data Structures and Algorithms PDF
Summary
This is a question bank for an Algorithm course at Parul Institute of Engineering and Technology. Topics covered include dictionaries, recursion, stacks, queues, time complexity, sorting, graphs, and hashing. The document includes questions and answers, code snippets, and explanations of key concepts.
Full Transcript
PARUL INSTITUTE OF ENGINEERING AND TECHNOLOGY COMPUTER ENGINEERING DEPARTMENT ALGORITHM (03606257) QUESTION BANK UNIT 1: Dictionaries 2 Mark Questions: 1. Define Array along with an example. 2. List out types of arrays and define any one of the...
PARUL INSTITUTE OF ENGINEERING AND TECHNOLOGY COMPUTER ENGINEERING DEPARTMENT ALGORITHM (03606257) QUESTION BANK UNIT 1: Dictionaries 2 Mark Questions: 1. Define Array along with an example. 2. List out types of arrays and define any one of them along with its representation. 3. Define Row Major Representation & Column Major Representation with an example. 4. Write down & explain a formula for Row major representation. 5. Write down & explain a formula for Column major representation. 6. Define Pointer with its syntax. 7. Define Recursion. Also write down its applications. 8. What is Data Abstraction? 9. Define Sets. Also list out Operations of sets. 10. Define Multisets and Multiplicity. Also make a list of Operations of Multisets. 3 Mark Questions: 1. Explain types of arrays in detail. 2. What is Row-major Representation? Also explain how elements will be arranged in this. 3. What is Column-major Representation? Also explain how elements will be arranged in this. 4. Explain Pointer in detail. 5. Given 2 sets: A={8,12,25,30} & B={12,22,25,31}. Perform Union, Intersection, Difference (A-B & B-A both) on these sets. 6. Given 2 multisets: P={a,a,a,b,d,d,e,e,e,e,e} & Q={a,a,c,d,d,d,f} 4 Mark Questions: 1. Given an array, a[1………15][0………10] with base value 2000 and the the size of each element is 2 Byte in memory. Find the address of a with the help of row-major representation. 2. Given an array, a[0………15][1………10] with base value 1200 and the array contains elements of float data type. Find the address of a with the help of column-major representation UNIT 2: Fundamentals Programming Models and String 2 Mark Questions: 1. What is Stack? Explain in brief. Also write down operations of stacks. 2. Write down an algorithm for PEEK operation on stack. 3. Define Queue. Also make a list of its operations. 4. Define: Enqueue & Dequeue. 5. List out any 4 applications of Queues. 6. Define Time Complexity. And list out 3 cases of time complexity. 7. Define String and make a list of functions of String. 3 Mark Questions: 1. Define all Operations of Stack. And write down an algorithm for PUSH operation on stack. 2. Define all Operations of Stack. Write down an algorithm for POP operation on stack. 3. Explain Enqueue algorithm with suitable example. 4. Explain Dequeue Algorithm with suitable example. 4 Mark Questions: 1. Explain strlen () & strrev () functions of String. UNIT 3: Analysis of Sorting and Searching 2 Mark Questions: 1. Explain the following terms: Time Complexity Space Complexity Algorithm Best Case Worst Case Average Case List out average and worst time complexity of Selection sort 3 Mark Questions: 1. Write down pseudo code for bubble sort and also write time complexity & space complexity of it. 2. Write down pseudo code for selection sort and also write time complexity & space complexity of it. 3. Apply merge sort on given list 36 25 40 2 7 80 15 4. Apply Quick sort on given list 9 7 5 11 12 2 14 3 10 6 5. Write down time complexity and space complexity for Quick sort and Radix sort. 6. Write down implementation steps for Insertion sort with its example 4 Mark Questions: 1. Explain analysis of Merge sort in detail. 2. Binary Search Tree: Construction, Insertion, Deletion, Balanced Tree, AVL Tree. UNIT 4: Graphs 2 Mark, 3 Marks and 4 Marks Questions 1. Definition of Directed Graph, Undirected Graph, Paths, Cycles, Directed Acyclic Graphs, Topological Sorting. 2. Difference between BFS and DFS and solve through given graph using DFS 3. Greedy Algorithms (Prim’s, Kruskal and Dijkstra Algorithm) UNIT 5: Hashing 1. What is hashing and hash table. 2. Hashing techniques 3. Rehashing 4. Collision Resolution Techniques. Answers UNIT 1: Dictionaries 1. Define Array along with an example. Definition of an array: An array is a set of character or set of values having same datatype of either integer of character or floating values with its byte value in an array. How to initialize an array? Datatype array_name[Size] = { Value1, Value2,...,ValueN}; How to use an array? Int a = {1, 2, 3, 4, 5};s Example of an array: #include using namespace std; int main () { int arr[] = { 1, 2, 3, 4 }; cout