- 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
Recursion is a function that invokes itself this is how it works when you have a recursive function you call that function inside the body of that function in Fibonacci sequence recursion is most ideal
time complexity is the amount of time an algorithm takes to solve a problem. and space complexity is the memory needed by the algorithm takes to solve a problem as the n value increases.
Linear data structures follow sequential order for instance Stack and the non-linear follow a non-sequential order for instances. Graphs and Trees
linear data are data elements that are arranged sequentially or linearly like in an array and binary structure are is a tree-like data structure where each node has at most two children, known as the left child and the right child
Linked List - is a dynamic linear data structure that comprises of sequential elements called nodes. Node has two parts, first part i the actual data stored in that node and second part is the pointer that points to the next node. Linked Lists grow and shrink during runtime unlike arrays that have a fixed size.
Stack - is a dynamic linear data structure that has allows operations to be done in one end only which is called a top of a stack it uses an order of Last In and First Out
Queue- is a dynamic linear data structure that has both ends open but inserting a new element can only be done at the end of the queue also called "rear" using Enqueue() operation and deletion or removal of an element can only be done at the front of the queue also called "front" using a Dequeue() operation
Members : Sharon Matyila
: Ntokozo Mnguni
: Simphiwe Ndlovu