Link copied to clipboard. Share away!

Dismiss

Published on 11 Mar 2020

Data Structures and Algorithms consists of some of the most important topics asked by Product companies (** Microsoft, Amazon, D.E Shaw, Directi, Intel, Nutanix, KPIT, etc**) for placement tests. A list of programs based on these topics, ranging from easy to advanced difficulty level is given below with solutions.

*Programs on arrays**Programs on stacks, queues and linked list**Problems on trees and graphs**Dynamic programming problems*

- Basic array operations (Insert, delete and search an element)
- Smallest and largest element in an array
- Sum of elements in an array
- Check if two arrays are the same or not
- Finding the array type
- Sum of positive square elements in an array
- Second smallest element in an array
- Sorting the elements of an array
- Reversing an array
- Longest palindrome in an array
- Count distinct elements of an array
- Print all distinct elements in an array
- Non-repeating elements of an array
- Repeating elements in an array
- Remove duplicate elements in an array
- Minimum scalar product of two vectors
- Maximum scalar product of two vectors
- Can the numbers of an array be made equal?
- Missing elements of a range
- Triplets with a given sum
- Frequency of each element of an array
- Symmetric pairs in an array
- Maximum product subarray in a given array
- Arrays are disjoint or not
- Array is a subset of another array or not
- Can all numbers of an array be made equal
- Minimum sum of absolute difference of given array
- Sorting elements of an array by frequency
- Sort an array according to the order defined by another array
- Replace each element of the array by its rank in the array
- Equilibrium index of an array
- Array rotation Left and right
- Block swap algorithm for array rotation
- Juggling algorithm for array rotation
- Circular rotation of an array by K positions
- Convert an array into a zig-zag fashion
- Merge two sorted arrays
- Longest subarray having an average greater than or equal to k
- Rearrange positive and negative numbers in an array
- Sum of all odd frequency elements in an array
- Median of two sorted arrays
- 0-1 Knapsack problem
- K'th smallest element in an unsorted array

- Matrix operations (Addition and subtraction)
- Transpose of a matrix
- Upper triangular matrix or not
- Lower triangular matrix or not
- The maximum element in a row
- The maximum element in a column
- Sum of each row and column of a matrix
- Saddle point coordinates of a given matrix
- Sum of elements in the zig-zag sequence of a matrix
- Sum of boundary elements of a matrix
- Matrix printing in a spiral form
- Rotate the matrix by K times
- Matrix rotation by 90 degrees clockwise and anticlockwise
- Maximum size of square submatrix with all 1s in a binary matrix

- Stack implementation using arrays
- Stack implementation using a Linked list
- Balanced parenthesis checker
- Redundant braces
- Sorting a stack using a temporary stack
- Infix to postfix using a stack
- Infix to prefix using a stack
- Queue using arrays
- Queue using a linked list
- Circular queue using arrays and Linked list
- Implement stack using a queue
- Implement queue using a stack
- Reversing a queue
- Reverse first k elements of a queue
- Program to return the nth node from the end in a linked list
- Remove duplicates from a linked list
- Reverse a linked list
- Detect a loop in a linked list

- Height of a binary tree
- Product of all leaf nodes of binary tree
- Find kth maximum value in a binary search tree
- Graph is a tree or not
- Nodes at k distance from the root
- Ancestors of a given node in a binary tree
- The vertical sum of a tree
- Implement Depth First Search (DFS)
- Implement Breadth First Search (BFS)
- Number of edges in an undirected graph
- Shortest path between two vertices
- Trace all paths of a directed graph

- Open and closed gates problem
- Number of Islands
- N digit numbers with digits in non-decreasing order
- Maximum number of As using four keys
- Minimum number of jumps to reach the end of an array
- Subset sum problem
- Rat in a maze problem
- Minimum and maximum values of a given expression
- Minimum sum partition problem
- Number of ways to reach the n'th stair
- Word break problem
- Two player coin game
- Sudoku problem
- Maximum sum in a array such that no two elements are adjacent
- Treasure and cities problem

- Data Structures Interview Questions with answers
- C Programming Tutorials for Beginners: C Programming from Scratch
- 150 + C Programming Questions with solutions
- 30 + Most Asked C Programming Interview Questions with Answers
- Python Programming for Beginners

data structures
C Programming
C++ Programming
Java Programming
Python Programming
Interview Preparation

If you have any feedback about this
article and want to improve this, please write to **enquiry@faceprep.in**

Explore 'data structures'

×