Algorithm Questions
-
Which sorting algorithm to use and when? Quick Sort, Bubble Sort, Selection Sort, Merge Sort
-
Explain what is an algorithm in computing?
-
Describe the types of Data Structures?
-
What is the merge sort? How does it work?
-
What are the advantages of a linked list over an array? In which scenarios do we use Linked List and when Array?
-
Explain what is a recursive algorithm?
-
Explain what is bubble sort algorithm?
-
What is a binary tree?
-
What is a linked list?
-
Mention what are the types of Notation used for Time Complexity?
-
“Write a function to return an n element in Fibonacci sequence”. Your function should return: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …
Quick Sort: is one of the most efficient sorting algorithms. It is based on the splitting of an array or list into smaller ones and swapping values based on the comparison with the ‘pivot’ element selected. It is more effective for data that can fit in memory. Otherwise merge sort is preferred.
Bubble Sort: The simplest but most inefficient sorting algorithm, it repeatedly cycles through a list, compares adjacent values, and swaps them if they are in the wrong order. It is mostly used when array is small or if large data which is nearly sorted.
Selection Sort: It is a fast and simple comparison-based sorting algorithm. It sorts by finding the minimum element repeatedly in an array. It is mostly used when an array is small as its time complexity makes it inefficient for larger arrays.
Merge Sort: One of the most efficient algorithms, it uses the principle of divide and conquer. It iteratively breaks down lists into sub-lists consisting of single elements and then merges these elements as per the requirements. Widely used in case of linked list or where the known data is similar.