Submitted By: Amna Saman Submitted To: Sir Saqib Ameer Section: Bsse 4 C Roll No: 14912 Riphah International University of Faisalabad
Submitted By: Amna Saman Submitted To: Sir Saqib Ameer Section: Bsse 4 C Roll No: 14912 Riphah International University of Faisalabad
Q No 2
Write Down Any four types of Strategies to solve the Algorithmic
Problems?
Solution
Recursion
Brute force
Backtracking
Iteration
The for loop
The for-each loop
The while loop
The do-while loop
Recursion
Recursion is repetition achieved through method calls. A recursive
method makes repeated calls to itself before returning a result. A result is
returned if and only if a base case exists.
This base case ensures that the solution converges otherwise an infinite
recursion occurs which in turn leads to a stack overflow.
Brute Force
This is a naive strategy that considers all possible solutions. This strategy
is also known as the complete or exhaustive search.
Backtracking
Q NO 3
Find the Lower , Upper And Tight Bound of the following
Examples?