Problem Statement: Given an integer N, return the first N rows of Pascal’s triangle. In Pascal’s triangle, each number is

Continue reading# Category: Data Structure

## Add two numbers represented as Linked Lists

Problem Statement: Given the heads of two non-empty linked lists representing two non-negative integers. The digits are stored in reverse

Continue reading## Reverse a Linked List

Problem Statement: Given the head of a singly linked list, write a program to reverse the linked list, and return

Continue reading## Sort an array of 0s, 1s and 2s

Problem Statement: Given an array consisting of only 0s, 1s and 2s. Write a program to in-place sort the array

Continue reading## Find middle element in a Linked List

Problem Statement: Given the head of a singly linked list, return the middle node of the linked list. If there

Continue reading