This is a repository containing various C++ Programs to understand the basic concepts of Data Structures and Algorithms.
-
C++ Code for solving the 0-1 Knapsack problem using Dynamic Programming approach.
-
C++ Code for solving the Fractional Knapsack problem using Greedy approach.
-
Longest Common Subsequence (LCS):
C++ Code for solving Longest Common Subsequence (LCS) problem.
-
C++ Code for implementing a Linked List.
-
C++ Code for implementing Linked List reversal.
-
C++ Code for implemention of a queue.
-
C++ Code for implementing a queue using two stacks.
-
C++ Code for implementing a queue using single stack (using recursion).
-
C++ Code for implemention of a stack.
-
C++ Code for implementing a stack using two queues.
-
C++ Code for implementing a stack using single queue.
-
C++ Code for implementing Merge Sort algorithm.
-
C++ Code for implementing Quick Sort algorithm.
-
C++ Code for implementing Randomized version of Quick Sort algorithm.
-
C++ Code for implementing Insertion Sort algorithm.
-
C++ Code for implementing Bubble Sort algorithm.
-
C++ Code for implementing Selection Sort algorithm.
-
C++ Code for implementing Binary Search algorithm recursively.
-
C++ Code for implementing Binary Search algorithm iteratively.
-
C++ Code for implementing Linear Search algorithm.
-
C++ Code for checking the balancing of Parenthesis.
-
Generate Balanced Parenthesis:
C++ Code to generate balanced parenthesis of the given order.
-
Decreasing Frequency-Wise Array Sorting:
C++ Code for performing decreasing frequency-wise sorting of a given array.
-
Checking Sorting of Array with atmost One Swapping of Elements:
C++ Code for checking whether it is possible or not to sort the given array by doing atmost one swapping of elements of array.
-
Anti-Clockwise Rotation of Array by 90 :
C++ Code for rotating the elements of the matrix by 90 degrees in anti-clockwise direction.
-
Clockwise Rotation of Array by 90:
C++ Code for rotating the elements of the matrix by 90 degrees in clockwise direction.
-
Finding Pair of Elements with given Sum in an Array:
C++ Code for finding the pair of elements in an array whose sum is equal to a particular sum entered by the user.
-
Finding Pair of Elements with given Sum in an Array using Hashing Method:
C++ Code for finding all the pairs of elements in an array whose sum is equal to a particular sum entered by the user by using the hashing set method.
-
Finding the Pythgorean Triplets present in an Array:
C++ Code for finding the triplet of elements present in an array which act as a Pythagorean Triplet.
-
Generating the Pythgorean Triplets till a particular Limit:
C++ Code for generating the Pythagorean Triplets having values less than a limit entered by a user.
-
Number Occurring Odd no. of Times in an Array:
C++ Code for finding the number which occurs odd no. of times in the given array.
-
Largest Contiguous Sum in an Array:
C++ Code for finding the largest contiguous sum present in the given array.
-
Segregate 0s and 1s in an Array:
C++ Code for segregating 0s and 1s in the given array.
-
Second Largest Element in an Array:
C++ Code for finding the second largest element present in the given array.
-
First Non-Repeating Character in an String:
C++ Code for finding the first non-repeating character present in the given string.
-
Remove Duplicates from a Sorted Array:
C++ Code for removing duplicate elements present in a sorted array.
-
Check Binary Representation of a number is Palidrome or not:
C++ Code for checking whether binary representation of a number is palindrome or not.
-
Check whether two strings are anagrams of each other:
C++ Code for checking whether two given strings are anagrams of each other.
-
Rotation Count in a Rotated Sorted Array:
C++ Code for finding the rotation count in a rotated sorted array.