- Discuss the concept of recursion in programming. How does it work, and in what scenarios might recursion be more advantageous than iterative solutions?
- Explain the difference between time complexity and space complexity in algorithms. Why is it important to consider both when evaluating the efficiency of an algorithm?
- What distinguishes linear data structures from non-linear data structures? Provide examples and use cases where one might be preferred over the other.
- Discuss difference between linear and binary search
- In your own words explain the following data structures:
- Linked List
- Stack
- Queues
Answers.
It is a function that that calls itself repeatedly.
Time Complexity- Refers to the amount of time it takes for the algorithm to complete its execution
Space Complexity- The amount of memory that it uses during its execution
We are trying to find a balance between the two and to pick the best algorithm for different situations.
Linear data structures-It aligns data in a linear sequence, examples include arrays, lists or queues
Non- linear data structure connects two or more information items, examples include a graph and a tree.
Linear checks each element until it finds the element that it is looking for and the binary search it divides the list into half and searches for the element.
Linked List- it is a series of nodes that are linked together through pointers.
Stack- It is a data structure that uses the last in first out method where elements are added and
removed from the top of the stack, allowing for efficient insertion and deletion operations.
Queue- It is a data structure that uses that first in first out. You add elements to the end of the queue and you remove them the front.
Breakout room (Phamela, Letago, Vuyo, Koni)