Demo Algorithms
- Overview
- Download
- Requirements
- Build
- String Algorithms
- Math and Arrays Algorithms
- Linked List
- Trees
- Graphs
- Queues
- Stack
- Binary Search
- Prefix Sums
- Two Pointers
Nothing special, just an attempt to structure and study C++ algorithms
- Copy/clone the project repo:
git clone https://github.com/AndreyTokmakov/Algorithms.git
- move to the project folder:
cd Algorithms
- C++23 (.. but will compile even with C++17 ... just need to update CMakeList files)
- Cmake
- Clone the project repo:
git clone https://github.com/AndreyTokmakov/Algorithms.git
- Move to the project folder:
cd Algorithms
- Configure project build (with cmake):
cmake -DCMAKE_BUILD_TYPE=Release -B./build
- Build and compile solution:
cd build && make -j4
- Is_Palindrome
- Is_Palindrome_Ignore_Invalid_Chars
- Are_Anagrams
- Check_If_Strings_Rotate_Rotate_Equals
- Check_If_Two_Strings_Are_Permutation
- Find_First_Char_Encountered_Once
- Find_First_K_Chars_Encountered_Once
- Find_If_String_IsSubstring_OfAnother
- Find_Last_Not_Of
- Find_Longest_Substring_With_K_Distinct_Characters
- Find_Common_Characters
- Move_Chars_To_End
- Move_Zeros_To_End
- Print_1_0_Instead_Wildcards
- Remove_Adjacent_Duplicates
- Remove_Chars_Of_One_String_FromAnother
- Remove_Duplicates_Chars
- Reverse_String
- Top_K_Frequent_Words
- Check_Valid_Parentheses_3_Bracket
- Longest_Substring_Without_Repeating_Characters
- Longest_Substring_Without_Repeating_Characters_2
- To_Lower_Case
- Robot_Return_To_Origin
- String_To_Integer
- String_To_Integer_2
- Single_Row_Keyboard
- Destination_City
- Maximum_Consecutive_Characters_SubString
- Is_Words_Can_Be_Formed_by_Characters
- Int_To_Roman
- Roman_To_Int
- Count_Anagrams
- Intersperse_String
- Find_Longest_Word
- Reverse_Words_in_String
- Find_Common_Prefix_And_Postfix
- Find_Duplicate_Symbols
- Get_String_Length
- Is_String_Contains_Another_String
- Find_K_Most_Frequent_Character
- Longest_Substring_With_Maximum_K_Unique_Characters
- Jewels_and_Stones
- Simplify_Path
- Split_String_All_SubString_Don_Have_Same_Chars
- Longest_Palindrome
- Sort_String__Rearrange_String
- Sort_String__Rearrange_String_2
- Check_Valid_Parentheses_1_Bracket
- Calc_Parentheses_K_Deletions_Make_Valid
- Longest_Common_Prefix
- Add_Digits
- Best_Time_Buy_and_Sell_Stock
- Find_Element_Encountered_Only_Once
- Find_The_Duplicate_Value
- Find_SubArrays_Sum_Zero
- Find_SubArrays_Sum_Equal_K
- Find_SubArray_Sum_Equal_K_Single
- Find_Top_K_Frequent_Numbers
- Find_N_Min_Elements
- Find_N_Max_Elements
- Find_Rank
- Find_First_Repeating_Element
- Find_Multiplier_Pair
- Find_Peak_Element
- Find_Missing_Number
- Find_Missing_Number_2
- Find_Missing_Number_Any_Range
- Find_Missing_Number_Sorted_Array
- Find_Missing_K_Number_Sorted_Array
- Find_Missing_K_Positive_Number_Sorted_Array
- Find_Missing_K_Number_Unsorted
- Find_Longest_SubArray_K_Unique_Elements
- Find_Longest_Increasing_Subsequence
- Find_Smallest_Without_Compare
- Find_Index_In_Array_to_make_Right_Equal_Left
- Find_Smallest_Missing_Positive_Number
- Find_The_Majority_Element
- Median_of_Two_Sorted_Arrays
- MidPoint
- Reverse_Bits
- Reverse_Number
- Reverse_To_Make_Equal
- Single_Number
- Two_Sum_Less_Than_K
- Remove_Duplicates_From_Sorted_Array
- Remove_Duplicates
- Remove_Element
- Contains_Duplicate
- Longest_Harmonious_Subsequence
- Is_Palindrome
- Is_Reversed_Equals
- Is_Prime
- Is_Power_Of2
- Is_Permutation
- Coins_Change_Problem
- Get_Number_Of_Digit
- Greatest_Common_Divisor
- Least_Common_Multiple
- Can_Jump
- Maximum_Sum_SubArray_Algorithms_Kadane
- Sort_Array_By_Parity
- Contains_Nearby_Duplicates
- Divide_Without_Division_Operator
- Longest_Consecutive_Sequence
- Add_One_to_Integer_Array
- Sqrt
- Min_Length_SubArray_WithSameDegree
- Maximum_Area_Between_Boundaries
- Calculate_Max_Hotel_Visitors
- Smallest_Subarray_With_Sum_Greater_Than_K
- Sum_of_Sub_Array_Between_Indexes_L_and_R
- Fixed_Point_SmallestIndex_ValueEqualIndex
- Longest_Subarray_With_Sum_Less_Than_K
- Squares_of_a_Sorted_Array
- Container_With_Most_Water
- Unique_Permutations
- House_Robber
- Single_Number_2
- Find_First_and_Last_Position_of_Element_Sorter_Arrays
- Longest_Subset_With_Positive_Bitwise_AND
- Find_Pair_Sum_Equal_K
- Kadane_Algorithm
- First_Bad_Version
- Add_Two_Numbers
- Check_If_Palindrome
- Check_List_Is_Cycled
- Delete_Duplicates
- Delete_Duplicates_SortedList
- Delete_K_Element_From_the_End
- Delete_Node_By_Position
- Delete_Nodes_By_Value
- Find_Middle_Element
- Find_Nth_Element_FromTheEnd
- Get_Length
- Insert_Into_Sorted_List
- Merge_Two_Lists
- Move_All_Occurrences_To_The_End
- Remove_N_Node_From_End
- Reverse_List
- Merge_K_Sorter_Lists
- Find_Lowest_Common_Ancestor
- Find_Min_and_Max_Element_NonRecursive
- Find_Min_and_Max_Element_Recursive
- Find_N_th_MinElement
- Find_N_th_Smallest_Element
- Largest_Element_In_Each_Level
- Sorted_Array_To_Binary_Tree
- Sorted_Array_To_Binary_Tree_NonRecursive
- Find_Lowest_Common_Ancestor
- Count_Elements
- Get_Tree_Depth
- Check_Is_Tree_Symmetric
- Check_Is_Trees_Identical
- Check_Is_Tree_Balanced
- Find_Maximum_Level_Sum
- Find_Path_Sum_Between_Two_Nodes
- Find_Maximum_Node_At_Given_Level
- Find_Level_With_Maximum_Sum
- Find_Search_Element_in_BST
- Find_Deepest_Node
- Find_Element_Parent
- Find_If_Last_Level_Completed
- Check_Is_Binary_Search_Tree_BST
- Check_Is_Tree_Complete
- Get_Tree_Min_Depth
- Print_Left_View
- Print_Right_View
- Print_Top_View
- Tree_Traversal_Level_Order
- Tree_Traversal_Inorder
- Tree_Traversal_Backward
- Tree_Traversal_PreOrder
- Tree_Traversal_PostOrder