My implementations for commonly asked questions in interviews. Method names are in italics. You can find the full implementation in this link https://github.com/kmdarshan/practice or you can refer to individual implementations as shown below.
- Reverse a string reverseString(str: String)
- Reverse string in place reverseStringInPlace
- Print two sum in a array printTwoSum
- Implement Queue using Stacks QueueUsingStacks
- Binary Search Tree And Check For Validity BST https://github.com/kmdarshan/practice/blob/master/binarySearchTree.swift
- Combine Two Sorted Arrays https://github.com/kmdarshan/practice/blob/master/combine_sorted_arrays.swift
- Print Common Numbers In Arrays printCommonNumbersIn
- Validate the brackets BracketValidator
- Get the maximum people living in a particular year GetMaximumYearPeopleLiving
- Adjacency graph / Graph Coloring Problem AdjacencyGraph graphColoringProblem
- Reverse Words in a Array https://github.com/kmdarshan/practice/blob/master/reverseWords.swift
- Graph Traversal (Breadth First Search and Depth First Search) https://github.com/kmdarshan/practice/blob/master/graph_with_dfs_bfs.swift
- Check if all permutations of the word is palindrome or not https://github.com/kmdarshan/practice/blob/master/check_palindrome.swift
- Implement a custom nsnotification center in swift https://redflowerinc.com/implementing-nsnotificationcenter-in-swift/
- Deleting a node from a binary search tree in swift https://github.com/kmdarshan/practice/blob/master/delete_from_a_binary_search_tree.swift
- Find if the binary tree is balanced https://github.com/kmdarshan/practice/blob/master/balanced_tree.swift
- Find if a string is permutation palindrome https://github.com/kmdarshan/practice/blob/master/permutation_palindrome.swift
- Find shortest path between two nodes in a graph https://github.com/kmdarshan/practice/blob/master/bfs_search_graph_find_minimum_distance.swift
- Dynamic Programming – Knapsack problem https://github.com/kmdarshan/practice/blob/master/knapsack.swift
- Second Largest Item in a binary search tree https://github.com/kmdarshan/practice/blob/master/second_largest_item_in_binary_search_tree.swift
More implementations are available here Gist