Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Pre membership task Ayush Chauhan #13

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion Competitive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,61 @@ You need to create a pull with YourName.extension in the respective solutions fo

Ex- If you are solving Problem no 0, your name is abhishek and you are solving it in C++,

Create a pull in the solutions folder of problem 0 with your solution in a file named Abhishek.cpp
Create a pull in the solutions folder of problem 0 with your solution in a file named Abhishek.cpp



## Question 0: Understand the pattern and write the code accordingly.

#size 3

----c----
--c-b-c--
c-b-a-b-c
--c-b-c--
----c----

#size 5

--------e--------
------e-d-e------
----e-d-c-d-e----
--e-d-c-b-c-d-e--
e-d-c-b-a-b-c-d-e
--e-d-c-b-c-d-e--
----e-d-c-d-e----
------e-d-e------
--------e--------


## Question 1: Write a function to check if a linked list has a loop.

* The function accepts start of the linked list.
* The function returns corresponding boolean value.


## Question 2: Write a function to check if the parentheses in an expression is balanced or not. [Using Stack].

Input: exp = “[()]{}{[()()]()}”
Output: Balanced

Input: exp = “[(])”
Output: Not Balanced

## Question 3: Write a function which takes n as input and returns the corresponding nth fibonacci number.
NOTE: You have to use recursion.
You have to make sure program works even for 100th fibonacci number.

## Question 4: Write a function to find the sum of all the leaf node of a binary tree, you are given root of the tree.
10
/ \
20 30
/ / \
40 50 60

Result : 40 + 50 + 60 = 150.



For any doubt contact : Anubhav ([email protected]) (9521419475)