#Algorithms implemented in C/C++
✅ Completed ⭕In progress
- String Manipulation
- CTCI chapter 1 ✅
- Linked Lists
- [Challenges from HackerRank] (https://www.hackerrank.com/domains/data-structures/linked-lists) ✅
- CTCI chapter 2 ✅
- Binary Trees
- [Challenges from HackerRank] (https://www.hackerrank.com/domains/data-structures/binary-trees) ✅
- CTCI chapter 4
###GENERAL-QUESTIONS / INTEVRVIEW-PRACTICE
-
Program to which gives the next number in the Fibonacci sequence when called, starts off with 1(ignore 0).Ex: 112358
-
Rock the Dates: Write functions to find the next day/previous day given a date, find a date after n days, check if a date is valid,etc. To add some challenge assume that the inputs are pointers to date structures. Please feel free to add any other functions you want!
-
Zip function: You have 2 arrays of equal length, you need to merge the corresponding elements of the array into one array and return an array of arrays at the end. Conside the example of array [a,b,c] and [d,e,f] the function should return [[a,d],[b,e],[c,f]].
-
Array of Strings in C: C program that contains a varied list of functions, that use dynamic memory to handle an array of strings in C. Sorting function added.
-
Array representation of a binary tree: C program that represents a binary tree using an array. Partial implementation of serealization and deserealization.
-
Kth minimum element: C Program to find the kth minimum element in array, quite common in interviews(I was asked this in the Zynga interview).
-
Binary tree to List: C program to convert a binary tree to a list.
-
Binary Arithmetic Using Binary trees: C program that uses binary trees to perform BODMAS calcualations
-
Amortized analysis and Dynamic Array: C program that implements and explains amortized(average) analysis and simple intro to dynamc arrays
-
Linked List: The interface file contains various function implemented using and for linked list. Great excercise to get familiar with them.
-
Binary Search Tree: Implementation and various fuctions for operations such as traversal, sorting, searching, etc in bst's.
-
Max-Min Stack: Implementation of stack that stores the maximum and minimum elements (can be retrieved in O(1) time), functions include pop, push, max , min, length, etc.
-
Count/Sequence ADT: Implementation for storing the count (number of occurrences of an integer within a sequence and other operations related to it. Implemented using an dynamica array and using a binary search tree.
-
Queue ADT: Implementation of Queue and various operations list add-front, remove-back, etc.
-
Dictionary ADT: Implementation of Dictionary adt and various operations like lookup, insert, traversal etc.
-
Towers of Hanoi Puzzle: Implementation of the recursive algorithm solution to the [Towers of Hanoi puzzle] (https://en.wikipedia.org/wiki/Tower_of_Hanoi)
-
Level Order Traversal: Implement the level order traversal of a binary tree and state the time complexity
-
Reverse in groups: Implement a program to reverse a linked list in groups of size k and state time complexity
-
Is Binary Search tree : Implement a program to check whether a give tree is a binary search tree or not
-
Tree Traversals : Implement programs to demostrate- post-order, pre-order, inorder traversals. Implement both the recursive and iterative versions
-
Same tree : Implement a program to check whether 2 binary trees are the same. They need to have the same values and structure
-
Maximum element in tree: Implement a program to find out the maximum element in a binary tree
-
Pair of ints: (the exact question can be found on leetcode)
-
Permutations of a string: Given a string list all the possible permutations of a string
-
Different Number: Given an array arr of n unique non-negative integers, how can you most efficiently find a non-negative integer that is not in the array?
-
Alternating Characters: Find the minimum number of character deletions required for two given strings to be anagrams(check program header for sample input)
-
Hash Table: Implement a hash table using array and linked lists
-
Height of tree: Program to find the height or max depth of a binary tree
-
Remove spaces in a string: Given an string output a string with all the spaces removed
-
Reverse string-1: Given a string reverse it word by word
-
Reverse string-2: Given a string reverse it completely, character by character
-
Posfix Expression evaluation: Evaluate expressions given in reverse polish notation, input is an array of strings
-
Balanced Parentheses: Verify whether string has balanced parentheses. note: this questions assumes only round-bracket
-
Group Anagrams: Group all anagrams together from a given array of strings
-
Infix Expression evaluation: Asked in google interview, similar to postfix eval hence solution not provided.
-
First non-repeating character: Find the first non repeating character in string.
-
Word Break Problem: Given a dictionary of words and a string of characters, find if the string of characters can be broken into individual valid words from the dictionary.
-
String Rotation check: Check given 2 string and a isSubstring method whether one is a rotation of another.
-
String Compression: Given a string perform basic string compression.
-
Replace Spaces: Given a string replace spaces with a certain string
-
Remove duplicates: Remove duplicates from linked list (solution using hashMap)
-
Is palindrome: Verifiy whether string is a palindrome.
-
Remove extra spaces: Given a string remove unecessary spaces
-
Rename letter: Given a string of letters, implement method that outputs string of 1's and 0's of the same size
-
Array to Linked List: Make a linked list out of an array
-
Delete Node: Program to delete node from a linked list given the data value of the node to be deleted
-
Insertion sort: Given an integer array sort using insertion sort technique
-
Merge sort: Given an integer array sort using merge sort technique
-
Merge sorted arrays: Given two sorted arrays merge them preserving sorting [Asked by Google, Microsoft]
-
Arrays Pairs Swap: Given two arrays of integrs, find a pair of values (one from each array) that you can swap to give the two arrays the same sum, feel free to make trivial assumptions
-
Minimum distances: Given an array find the minimum distance between 2 equal elements in the array. If no such value exists, print -1. (https://www.hackerrank.com/challenges/minimum-distances)
###Interview Questions
Upcoming: Given a Binary Search Tree with integers at every node and an integer k, write code that decides whether or not there exists two nodes a and b such that a+b=k (The above question was asked in Zenefits interview)