In: Computer Science
Single, Double and Circular Linked List:
Single Linked List: In single linked list each node is consist of data and address of next node. Which only allow us to move/traverse in one direction. Insertion Complexity is O(n)
Double Linked List: In Doubly Linked List each node is consist of data , address of next node and address of previous node. Which only allow us to move/traverse in both direction bi-direction. Insertion Complexity is O(1).
Circular Linked List: In Circular linked list is just like a Single linked list but tail of linked list is connected to head of linked list.
Recursion Function of Factorial in Python:
def factorial(n):
if n == 1:
return n
else:
return n*factorial(n-1)
Iterative Function of Factorial in Python:
def iterativeFactorial(n):
fact = 1
for i in range(1,n + 1):
fact = fact * i
return fact
BST PRE AND POST ORDER
IF YOU HAVE ANY QUERY PLEASE
COMMENT DOWN BELOW.
PLEASE GIVE A THUMBS UP