├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── Arrays ├── Array_Intersection_Calculator │ ├── Array_Intersection_Calculator.txt │ ├── Solution │ │ ├── Array_Intersection_Calculator.c │ │ ├── README.md │ │ ├── main.c │ │ └── main.exe │ ├── a.out │ └── sid_solution.c ├── Array_Leaders_Finder │ ├── Array_Leaders_Finder.txt │ ├── Solution │ │ ├── README.md │ │ └── main.c │ ├── a.out │ └── sid_solution.c ├── Array_Product_Excluding_Self_Calculator │ ├── Array_Product_Excluding_Self_Calculator.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Array_Right_Rotator │ ├── Array_Right_Rotator.txt │ └── Solution │ │ └── README.md ├── Divisible_Sum_Pairs_Checker │ ├── Divisible_Sum_Pairs_Checker.txt │ └── Solution │ │ └── README.md ├── Duplicate_Number_Detector │ ├── Duplicate_Number_Detector.txt │ └── Solution │ │ └── README.md ├── Duplicate_Remover_without_Libraries │ ├── Duplicate_Remover_without_Libraries.txt │ └── Solution │ │ └── README.md ├── Equilibrium_Index_Finder │ ├── Equilibrium_Index_Finder.txt │ └── Solution │ │ └── README.md ├── Kth_Max-Min_Element_Retriever │ ├── Kth_Max-Min_Element_Retriever.txt │ └── Solution │ │ └── README.md ├── Longest_Consecutive_Subsequence_Locator │ ├── Longest_Consecutive_Subsequence_Locator.txt │ └── Solution │ │ └── README.md ├── Majority_Element_Identifier │ ├── Majority_Element_Identifier.txt │ └── Solution │ │ └── README.md ├── Max-Min_Finder_in_an_Unsorted_Array │ ├── Max-Min_Finder_in_an_Unsorted_Array.txt │ └── Solution │ │ └── README.md ├── Minimum_Sum_Subarray_Finder │ ├── Minimum_Sum_Subarray_Finder.txt │ └── Solution │ │ └── README.md ├── Missing_Number_Finder_in_a_1-to-500_Sequence │ ├── Missing_Number_Finder_in_a_1-to-500_Sequence.txt │ └── Solution │ │ └── README.md ├── Multiple_Duplicates_Identifier │ ├── Multiple_Duplicates_Identifier.txt │ └── Solution │ │ └── README.md ├── Occurrence_Counter_in_a_Sorted_Array │ ├── Occurrence_Counter_in_a_Sorted_Array.txt │ └── Solution │ │ └── README.md ├── Peak_Element_Identifier │ ├── Peak_Element_Identifier.txt │ └── Solution │ │ └── README.md ├── Positive-Negative_Rearranger │ ├── Positive-Negative_Rearranger.txt │ └── Solution │ │ └── README.md ├── Quicksort_Array_Sorter │ ├── Quicksort_Array_Sorter.txt │ └── Solution │ │ └── README.md ├── Self-Referential_Array_Transformer │ ├── Self-Referential_Array_Transformer.txt │ └── Solution │ │ └── README.md ├── Sorted_Arrays_Merger │ ├── Solution │ │ └── README.md │ └── Sorted_Arrays_Merger.txt ├── Target_Sum_Pairs_Locator │ ├── Solution │ │ └── README.md │ └── Target_Sum_Pairs_Locator.txt ├── Two_Repeating_Elements_Finder │ ├── Solution │ │ └── README.md │ └── Two_Repeating_Elements_Finder.txt ├── Zero-Mover_to_the_Left │ ├── Solution │ │ └── README.md │ └── Zero-Mover_to_the_Left.txt └── Zero_Sum_Subarray_Detector │ ├── Solution │ └── README.md │ └── Zero_Sum_Subarray_Detector.txt ├── Bit_Manipulations ├── Calculate_a_power_b_Using_Bit_Manipulation │ ├── Calculate_a_power_b_Using_Bit_Manipulation.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Check_for_Alternate_Bits │ ├── Check_for_Alternate_Bits.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Check_if_Binary_Representation_of_a_Number_is_Palindrome │ ├── Check_if_Binary_Representation_of_a_Number_is_Palindrome.txt │ └── Solution │ │ └── README.md ├── Check_if_Number_is_Multiple_of_3 │ ├── Check_if_Number_is_Multiple_of_3.txt │ └── Solution │ │ └── README.md ├── Clear_Bits_From_MSB_to_i │ ├── Clear_Bits_From_MSB_to_i.txt │ └── Solution │ │ └── README.md ├── Convert_Decimal_to_Binary │ ├── Convert_Decimal_to_Binary.txt │ └── Solution │ │ └── README.md ├── Count_Number_of_Flips_to_Convert_A_to_B │ ├── Count_Number_of_Flips_to_Convert_A_to_B.txt │ └── Solution │ │ └── README.md ├── Count_Set_Bits │ ├── Count_Set_Bits.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Detecting_Power_of_Two │ ├── Detecting_Power_of_Two.txt │ └── Solution │ │ └── README.md ├── Determine_if_Two_Integers_Have_Opposite_Signs │ ├── Determine_if_Two_Integers_Have_Opposite_Signs.txt │ └── Solution │ │ └── README.md ├── Extract_n_Bits │ ├── Extract_n_Bits.txt │ └── Solution │ │ └── README.md ├── Find_Parity_of_a_Number │ ├── Find_Parity_of_a_Number.txt │ └── Solution │ │ └── README.md ├── Find_Two_Unique_Numbers_in_Array │ ├── Find_Two_Unique_Numbers_in_Array.txt │ └── Solution │ │ └── README.md ├── Find_a_Unique_Number_in_an_Array │ ├── Find_a_Unique_Number_in_an_Array.txt │ └── Solution │ │ └── README.md ├── Generate_All_Possible_Combinations_of_n_Bits │ ├── Generate_All_Possible_Combinations_of_n_Bits.txt │ └── Solution │ │ └── README.md ├── Implement_Bitwise_Right_Shift │ ├── Implement_Bitwise_Right_Shift.txt │ └── Solution │ │ └── README.md ├── Implement_XOR_Without_Using_XOR_Operator │ ├── Implement_XOR_Without_Using_XOR_Operator.txt │ └── Solution │ │ └── README.md ├── Isolate_the_Rightmost_Set_Bit │ ├── Isolate_the_Rightmost_Set_Bit.txt │ └── Solution │ │ └── README.md ├── Mask_Certain_Bits │ ├── Mask_Certain_Bits.txt │ └── Solution │ │ └── README.md ├── Reverse_Bits_in_a_Byte │ ├── Reverse_Bits_in_a_Byte.txt │ └── Solution │ │ └── README.md ├── Rotate_Bits │ ├── Rotate_Bits.txt │ └── Solution │ │ └── README.md ├── Set_Bits_Without_Using_Arithmetic_Operations │ ├── Set_Bits_Without_Using_Arithmetic_Operations.txt │ └── Solution │ │ └── README.md ├── Single_Number_in_Array │ ├── Single_Number_in_Array.txt │ └── Solution │ │ └── README.md ├── Swap_Odd_and_Even_Bits │ ├── Solution │ │ └── README.md │ └── Swap_Odd_and_Even_Bits.txt └── Toggle_3rd_and_5th_Bits │ ├── Solution │ └── README.md │ └── Toggle_3rd_and_5th_Bits.txt ├── Linked_List ├── Add_Numbers_Represented_by_Lists │ ├── Add_Numbers_Represented_by_Lists.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Clone_Linked_List_With_Random_Pointer │ ├── Clone_Linked_List_With_Random_Pointer.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Common_Ancestor_in_Binary_Tree_Doubly_Linked_List │ ├── Common_Ancestor_in_Binary_Tree_Doubly_Linked_List.txt │ └── Solution │ │ └── README.md ├── Compare_Strings_As_Linked_Lists │ ├── Compare_Strings_As_Linked_Lists.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Convert_Binary_Number_to_Integer │ ├── Convert_Binary_Number_to_Integer.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Delete_Alternate_Nodes │ ├── Delete_Alternate_Nodes.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Detect_And_Remove_Loop │ ├── Detect_And_Remove_Loop.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Detect_Cycle_in_LinkedList │ ├── Detect_Cycle_in_LinkedList.txt │ └── Solution │ │ └── README.md ├── Find_Middle_Element │ ├── Find_Middle_Element.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Find_Nth_Node_From_End │ ├── Find_Nth_Node_From_End.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Flatten_Multi_Level_Linked_List │ ├── Flatten_Multi_Level_Linked_List.txt │ └── Solution │ │ └── README.md ├── Intersection_Point_Two_Lists │ ├── Intersection_Point_Two_Lists.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Length_of_Linked_List │ ├── Length_of_Linked_List.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Linked_List_Is_Palindrome │ ├── Linked_List_Is_Palindrome.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Merge_Sort_on_Linked_List │ ├── Merge_Sort_on_Linked_List.txt │ └── Solution │ │ └── README.md ├── Merge_Two_Sorted_Lists │ ├── Merge_Two_Sorted_Lists.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Move_Last_Element_To_Front │ ├── Move_Last_Element_To_Front.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Pairwise_Swap_Elements │ ├── Pairwise_Swap_Elements.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Partition_Linked_List_Around_Value │ ├── Partition_Linked_List_Around_Value.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Remove_Duplicates_Unsorted │ ├── Remove_Duplicates_Unsorted.txt │ └── Solution │ │ └── README.md ├── Remove_Nodes_of_Specific_Value │ ├── Remove_Nodes_of_Specific_Value.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Reverse_Linked_List │ ├── Reverse_Linked_List.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Reverse_Linked_List_No_Recursion │ ├── Reverse_Linked_List_No_Recursion.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Segregate_Even_Odd_Nodes │ ├── Segregate_Even_Odd_Nodes.txt │ └── Solution │ │ ├── README.md │ │ └── main.c └── Sum_of_Linked_Lists_Using_Stack │ ├── Solution │ └── README.md │ └── Sum_of_Linked_Lists_Using_Stack.txt ├── Linux_Internals ├── CPU_Information_Fetcher │ ├── CPU_Information_Fetcher.txt │ └── Solution │ │ └── README.md ├── CPU_Scheduling_Algorithm │ ├── CPU_Scheduling_Algorithm.txt │ └── Solution │ │ └── README.md ├── Command_line_Argument_Parser │ ├── Command_line_Argument_Parser.txt │ └── Solution │ │ └── README.md ├── Custom_Signal_Handling │ ├── Custom_Signal_Handling.txt │ └── Solution │ │ └── README.md ├── Custom_init_Process │ ├── Custom_init_Process.txt │ └── Solution │ │ └── README.md ├── Custom_malloc_free │ ├── Custom_malloc_free.txt │ └── Solution │ │ └── README.md ├── Custom_ps_Command │ ├── Custom_ps_Command.txt │ └── Solution │ │ └── README.md ├── File_Copy_Program │ ├── File_Copy_Program.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Filesystem_Traversal_opendir_readdir │ ├── Filesystem_Traversal_opendir_readdir.txt │ └── Solution │ │ └── README.md ├── Implement_Priority_Inversion_Handling │ ├── Implement_Priority_Inversion_Handling.txt │ └── Solution │ │ └── README.md ├── Implement_Simple_Shell │ ├── Implement_Simple_Shell.txt │ └── Solution │ │ └── README.md ├── Implement_chmod_Command │ ├── Implement_chmod_Command.txt │ └── Solution │ │ └── README.md ├── Implement_ping_Command │ ├── Implement_ping_Command.txt │ └── Solution │ │ └── README.md ├── Implement_tail_Command │ ├── Implement_tail_Command.txt │ └── Solution │ │ └── README.md ├── Implement_watch_Command │ ├── Implement_watch_Command.txt │ └── Solution │ │ └── README.md ├── Implement_whois_Command │ ├── Implement_whois_Command.txt │ └── Solution │ │ └── README.md ├── Mutex_based_File_Access │ ├── Mutex_based_File_Access.txt │ └── Solution │ │ └── README.md ├── Priority_Inversion_Problem │ ├── Priority_Inversion_Problem.txt │ └── Solution │ │ └── README.md ├── Process_Forking_Waiting │ ├── Process_Forking_Waiting.txt │ └── Solution │ │ └── README.md ├── Semaphore_based_Producer_Consumer │ ├── Semaphore_based_Producer_Consumer.txt │ └── Solution │ │ └── README.md ├── Terminal_Multiplexer │ ├── Solution │ │ └── README.md │ └── Terminal_Multiplexer.txt ├── Thread_Creation_Synchronization │ ├── Solution │ │ └── README.md │ └── Thread_Creation_Synchronization.txt ├── User_Space_File_Reader │ ├── Solution │ │ └── README.md │ └── User_Space_File_Reader.txt ├── User_Space_to_Kernel_Space_Communication │ ├── Solution │ │ └── README.md │ └── User_Space_to_Kernel_Space_Communication.txt └── Zero_Copy_Data_Transfer │ ├── Solution │ └── README.md │ └── Zero_Copy_Data_Transfer.txt ├── Memory_Management ├── Custom_strdup_Function │ ├── Custom_strdup_Function.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Dynamic_Array │ ├── Dynamic_Array.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Fragmentation_Detector │ ├── Fragmentation_Detector.txt │ └── Solution │ │ └── README.md ├── Garbage_Collector_Simulator │ ├── Garbage_Collector_Simulator.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Heap_Metadata_Inspector │ ├── Heap_Metadata_Inspector.txt │ └── Solution │ │ └── README.md ├── Memory-Bound_Priority_Queue │ ├── Memory-Bound_Priority_Queue.txt │ └── Solution │ │ └── README.md ├── Memory-Mapped_Circular_Buffer │ ├── Memory-Mapped_Circular_Buffer.txt │ └── Solution │ │ └── README.md ├── Memory_Access_Logger │ ├── Memory_Access_Logger.txt │ └── Solution │ │ └── README.md ├── Memory_Alignment_Checker │ ├── Memory_Alignment_Checker.txt │ └── Solution │ │ └── README.md ├── Memory_Defragmenter │ ├── Memory_Defragmenter.txt │ └── Solution │ │ └── README.md ├── Memory_Footprint_Analyzer │ ├── Memory_Footprint_Analyzer.txt │ └── Solution │ │ └── README.md ├── Memory_Initialization_Library │ ├── Memory_Initialization_Library.txt │ └── Solution │ │ └── README.md ├── Memory_Leak_Detector │ ├── Memory_Leak_Detector.txt │ └── Solution │ │ └── README.md ├── Memory_Offset_Calculator │ ├── Memory_Offset_Calculator.txt │ └── Solution │ │ └── README.md ├── Memory_Overlay_Management │ ├── Memory_Overlay_Management.txt │ └── Solution │ │ └── README.md ├── Memory_Pool │ ├── Memory_Pool.txt │ └── Solution │ │ └── README.md ├── Memory_Safety_Checker │ ├── Memory_Safety_Checker.txt │ └── Solution │ │ └── README.md ├── Memory_Statistics_Reporter │ ├── Memory_Statistics_Reporter.txt │ └── Solution │ │ └── README.md ├── Object_Serialization │ ├── Object_Serialization.txt │ └── Solution │ │ └── README.md ├── Segmented_Memory_Allocator │ ├── Segmented_Memory_Allocator.txt │ └── Solution │ │ └── README.md ├── Slab_Allocator │ ├── Slab_Allocator.txt │ └── Solution │ │ └── README.md ├── Stack-based_Memory_Allocator │ ├── Solution │ │ └── README.md │ └── Stack-based_Memory_Allocator.txt ├── Stack_Overflow_Detector │ ├── Solution │ │ └── README.md │ └── Stack_Overflow_Detector.txt ├── Virtual_Memory_Simulator │ ├── Solution │ │ └── README.md │ └── Virtual_Memory_Simulator.txt └── Write-Once_Memory_Simulator │ ├── Solution │ └── README.md │ └── Write-Once_Memory_Simulator.txt ├── Pointers ├── Calculate_Dot_Product_Of_Vectors │ ├── Calculate_Dot_Product_Of_Vectors.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Check_Pointers_Point_To_Same_Array │ ├── Check_Pointers_Point_To_Same_Array.txt │ └── Solution │ │ └── README.md ├── Check_String_Palindrome │ ├── Check_String_Palindrome.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Check_String_Prefix │ ├── Check_String_Prefix.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Concatenate_Strings_Without_Lib │ ├── Concatenate_Strings_Without_Lib.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Convert_String_To_Lowercase │ ├── Convert_String_To_Lowercase.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Count_Array_Elements_Without_Loop │ ├── Count_Array_Elements_Without_Loop.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Custom_Memcpy_Function │ ├── Custom_Memcpy_Function.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Custom_Strtok_Function │ ├── Custom_Strtok_Function.txt │ └── Solution │ │ └── README.md ├── Detect_Pointer_Out_Of_Bounds │ ├── Detect_Pointer_Out_Of_Bounds.txt │ └── Solution │ │ └── README.md ├── Find_Array_Intersection │ ├── Find_Array_Intersection.txt │ └── Solution │ │ └── README.md ├── Find_Common_Elements_In_Sorted_Arrays │ ├── Find_Common_Elements_In_Sorted_Arrays.txt │ └── Solution │ │ └── README.md ├── Find_Data_Type_Size_Without_Sizeof │ ├── Find_Data_Type_Size_Without_Sizeof.txt │ └── Solution │ │ └── README.md ├── Find_First_Non_Repeated_Character │ ├── Find_First_Non_Repeated_Character.txt │ └── Solution │ │ └── README.md ├── Find_Linked_List_Length │ ├── Find_Linked_List_Length.txt │ └── Solution │ │ └── README.md ├── Find_Overlapping_Elements_In_Arrays │ ├── Find_Overlapping_Elements_In_Arrays.txt │ └── Solution │ │ └── README.md ├── Flatten_2D_Array_To_1D │ ├── Flatten_2D_Array_To_1D.txt │ └── Solution │ │ └── README.md ├── Memory_Leak_Detector │ ├── Memory_Leak_Detector.txt │ └── Solution │ │ └── README.md ├── Merge_Two_Sorted_Arrays │ ├── Merge_Two_Sorted_Arrays.txt │ └── Solution │ │ └── README.md ├── Move_2D_Point │ ├── Move_2D_Point.txt │ └── Solution │ │ └── README.md ├── Rotate_Array_By_K_Elements │ ├── Rotate_Array_By_K_Elements.txt │ └── Solution │ │ └── README.md ├── Segregate_Even_And_Odd_Using_Pointers │ ├── Segregate_Even_And_Odd_Using_Pointers.txt │ └── Solution │ │ └── README.md ├── Split_String_Into_Halves │ ├── Solution │ │ └── README.md │ └── Split_String_Into_Halves.txt ├── Swap_Two_Strings_Using_Pointers │ ├── Solution │ │ └── README.md │ └── Swap_Two_Strings_Using_Pointers.txt └── Trim_String_Whitespace │ ├── Solution │ └── README.md │ └── Trim_String_Whitespace.txt ├── README.md ├── Searching ├── Binary_search_recursive │ ├── Binary_search_recursive.txt │ └── Solution │ │ ├── README.md │ │ ├── main.c │ │ └── main1.c ├── Count_array_rotations │ ├── Count_array_rotations.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Count_number_occurrences │ ├── Count_number_occurrences.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Exponential_search │ ├── Exponential_search.txt │ └── Solution │ │ └── README.md ├── Fibonacci_search │ ├── Fibonacci_search.txt │ └── Solution │ │ └── README.md ├── Find_Kth_max_min │ ├── Find_Kth_max_min.txt │ └── Solution │ │ └── README.md ├── Find_first_last_occurrence │ ├── Find_first_last_occurrence.txt │ └── Solution │ │ └── README.md ├── Find_fixed_point │ ├── Find_fixed_point.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Find_majority_element │ ├── Find_majority_element.txt │ └── Solution │ │ └── README.md ├── Find_missing_number_1_to_N │ ├── Find_missing_number_1_to_N.txt │ └── Solution │ │ └── README.md ├── Find_peak_element │ ├── Find_peak_element.txt │ └── Solution │ │ └── README.md ├── Find_repeating_missing │ ├── Find_repeating_missing.txt │ └── Solution │ │ └── README.md ├── Find_smallest_missing │ ├── Find_smallest_missing.txt │ └── Solution │ │ └── README.md ├── Interpolation_search │ ├── Interpolation_search.txt │ └── Solution │ │ └── README.md ├── Jump_search │ ├── Jump_search.txt │ └── Solution │ │ └── README.md ├── Search_bitonic_array │ ├── Search_bitonic_array.txt │ └── Solution │ │ └── README.md ├── Search_nearly_sorted_array │ ├── Search_nearly_sorted_array.txt │ └── Solution │ │ └── README.md ├── Search_sorted_array │ ├── Search_sorted_array.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Search_sorted_matrix │ ├── Search_sorted_matrix.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Search_sorted_rotated_array │ ├── Search_sorted_rotated_array.txt │ └── Solution │ │ └── README.md ├── Search_unknown_length_array │ ├── Search_unknown_length_array.txt │ └── Solution │ │ └── README.md ├── Search_unsorted_array │ ├── Search_unsorted_array.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Sentinel_search │ ├── Sentinel_search.txt │ └── Solution │ │ └── README.md ├── Ternary_search │ ├── Solution │ │ └── README.md │ └── Ternary_search.txt └── Two_numbers_sum_N │ ├── Solution │ ├── README.md │ └── main.c │ └── Two_numbers_sum_N.txt ├── Sorting ├── Bead_Sort │ ├── Bead_Sort.txt │ └── Solution │ │ └── README.md ├── Bitonic_Sort │ ├── Bitonic_Sort.txt │ └── Solution │ │ └── README.md ├── Bogo_Sort │ ├── Bogo_Sort.txt │ └── Solution │ │ └── README.md ├── Bucket_Sort │ ├── Bucket_Sort.txt │ └── Solution │ │ └── README.md ├── Cocktail_Sort │ ├── Cocktail_Sort.txt │ └── Solution │ │ └── README.md ├── Comb_Sort │ ├── Comb_Sort.txt │ └── Solution │ │ └── README.md ├── Counting_Sort_for_Negative_Numbers │ ├── Counting_Sort_for_Negative_Numbers.txt │ └── Solution │ │ └── README.md ├── Cycle_Sort │ ├── Cycle_Sort.txt │ └── Solution │ │ └── README.md ├── Dynamic_Gap_Shell_Sort │ ├── Dynamic_Gap_Shell_Sort.txt │ └── Solution │ │ └── README.md ├── Gnome_Sort │ ├── Gnome_Sort.txt │ └── Solution │ │ └── README.md ├── Heap_Sort_with_Binary_Max_Heap │ ├── Heap_Sort_with_Binary_Max_Heap.txt │ └── Solution │ │ └── README.md ├── In_Place_Merge_Sort │ ├── In_Place_Merge_Sort.txt │ └── Solution │ │ └── README.md ├── Iterative_Quick_Sort │ ├── Iterative_Quick_Sort.txt │ └── Solution │ │ └── README.md ├── Linked_List_Insertion_Sort │ ├── Linked_List_Insertion_Sort.txt │ └── Solution │ │ └── README.md ├── Odd_Even_Sort │ ├── Odd_Even_Sort.txt │ └── Solution │ │ └── README.md ├── Optimized_Bubble_Sort │ ├── Optimized_Bubble_Sort.txt │ └── Solution │ │ └── README.md ├── Pancake_Sort │ ├── Pancake_Sort.txt │ └── Solution │ │ └── README.md ├── Patience_Sort │ ├── Patience_Sort.txt │ └── Solution │ │ └── README.md ├── Permutation_Sort │ ├── Permutation_Sort.txt │ └── Solution │ │ └── README.md ├── Pigeonhole_Sort │ ├── Pigeonhole_Sort.txt │ └── Solution │ │ └── README.md ├── Radix_Sort_for_Floating_Points │ ├── Radix_Sort_for_Floating_Points.txt │ └── Solution │ │ └── README.md ├── Recursive_Merge_Sort │ ├── Recursive_Merge_Sort.txt │ └── Solution │ │ └── README.md ├── Sleep_Sort │ ├── Sleep_Sort.txt │ └── Solution │ │ └── README.md ├── Stooge_Sort │ ├── Solution │ │ └── README.md │ └── Stooge_Sort.txt └── Tim_Sort │ ├── Solution │ └── README.md │ └── Tim_Sort.txt ├── Stacks_and_Queues ├── Balanced_Parentheses_Stack │ ├── Balanced_Parentheses_Stack.txt │ └── Solution │ │ └── README.md ├── Byte-Packing_Stack │ ├── Byte-Packing_Stack.txt │ └── Solution │ │ └── README.md ├── Circular_Queue │ ├── Circular_Queue.txt │ └── Solution │ │ ├── README.md │ │ └── main.c ├── Command_Parser │ ├── Command_Parser.txt │ └── Solution │ │ └── README.md ├── Expression_Validator │ ├── Expression_Validator.txt │ └── Solution │ │ └── README.md ├── Function_Call_Logger │ ├── Function_Call_Logger.txt │ └── Solution │ │ └── README.md ├── Min-Element_Stack │ ├── Min-Element_Stack.txt │ └── Solution │ │ └── README.md ├── Multi-stack_Array │ ├── Multi-stack_Array.txt │ └── Solution │ │ └── README.md ├── Nested_Statement_Counter │ ├── Nested_Statement_Counter.txt │ └── Solution │ │ └── README.md ├── Palindrome_Checker │ ├── Palindrome_Checker.txt │ └── Solution │ │ └── README.md ├── Post-order_Traversal_Stack │ ├── Post-order_Traversal_Stack.txt │ └── Solution │ │ └── README.md ├── Priority_Queue_Heap │ ├── Priority_Queue_Heap.txt │ └── Solution │ │ └── README.md ├── Queue-based_Cache │ ├── Queue-based_Cache.txt │ └── Solution │ │ └── README.md ├── Queue-based_Logger │ ├── Queue-based_Logger.txt │ └── Solution │ │ └── README.md ├── Queue-based_Sequence_Generator │ ├── Queue-based_Sequence_Generator.txt │ └── Solution │ │ └── README.md ├── Queue-based_Text_Filter │ ├── Queue-based_Text_Filter.txt │ └── Solution │ │ └── README.md ├── Queue_Two_Priorities │ ├── Queue_Two_Priorities.txt │ └── Solution │ │ └── README.md ├── Queue_from_Stacks │ ├── Queue_from_Stacks.txt │ └── Solution │ │ └── README.md ├── Radix_Sort_Queue │ ├── Radix_Sort_Queue.txt │ └── Solution │ │ └── README.md ├── Recursive_to_Iterative_Converter │ ├── Recursive_to_Iterative_Converter.txt │ └── Solution │ │ └── README.md ├── Stack-based_Calculator │ ├── Solution │ │ └── README.md │ └── Stack-based_Calculator.txt ├── Stack-based_Text_Editor │ ├── Solution │ │ └── README.md │ └── Stack-based_Text_Editor.txt ├── Stack_Sorting │ ├── Solution │ │ └── README.md │ └── Stack_Sorting.txt ├── String_Message_Queue │ ├── Solution │ │ └── README.md │ └── String_Message_Queue.txt └── Undo_Redo_Stack │ ├── Solution │ └── README.md │ └── Undo_Redo_Stack.txt ├── Strings ├── Alphabetically_Encoding_a_String │ ├── Alphabetically_Encoding_a_String.txt │ └── Solutions │ │ ├── README.md │ │ └── main.c ├── Checking_Anagrams_Between_Two_Strings │ ├── Checking_Anagrams_Between_Two_Strings.txt │ └── Solutions │ │ └── README.md ├── Counting_Balanced_Zero-One_Substrings │ ├── Counting_Balanced_Zero-One_Substrings.txt │ └── Solutions │ │ └── README.md ├── Counting_Character_Occurrences_in_a_String │ ├── Counting_Character_Occurrences_in_a_String.txt │ └── Solutions │ │ ├── README.md │ │ └── main.c ├── Counting_Substring_Occurrences_in_a_String │ ├── Counting_Substring_Occurrences_in_a_String.txt │ └── Solutions │ │ └── README.md ├── Counting_Vowels_and_Consonants_in_a_String │ ├── Counting_Vowels_and_Consonants_in_a_String.txt │ └── Solutions │ │ └── README.md ├── Discovering_the_Longest_Palindromic_Substring │ ├── Discovering_the_Longest_Palindromic_Substring.txt │ └── Solutions │ │ └── README.md ├── Evaluating_Repeated_Substring_Patterns │ ├── Evaluating_Repeated_Substring_Patterns.txt │ └── Solutions │ │ └── README.md ├── Evaluating_String_Interleaving │ ├── Evaluating_String_Interleaving.txt │ └── Solutions │ │ └── README.md ├── Finding_Lexicographically_Minimal_String_Rotation │ ├── Finding_Lexicographically_Minimal_String_Rotation.txt │ └── Solutions │ │ └── README.md ├── Finding_the_First_Unique_Character_in_a_String │ ├── Finding_the_First_Unique_Character_in_a_String.txt │ └── Solutions │ │ └── README.md ├── Finding_the_Most_Frequent_Character │ ├── Finding_the_Most_Frequent_Character.txt │ └── Solutions │ │ └── README.md ├── Generating_All_String_Permutations │ ├── Generating_All_String_Permutations.txt │ └── Solutions │ │ └── README.md ├── Identifying_Duplicate_Characters_in_a_String │ ├── Identifying_Duplicate_Characters_in_a_String.txt │ └── Solutions │ │ ├── README.md │ │ └── main.c ├── Identifying_Longest_Substring_Without_Repeats │ ├── Identifying_Longest_Substring_Without_Repeats.txt │ └── Solutions │ │ └── README.md ├── Listing_Multiple_Occurrences_of_Characters_in_a_String │ ├── Listing_Multiple_Occurrences_of_Characters_in_a_String.txt │ └── Solutions │ │ └── README.md ├── Minimizing_Palindromic_Partitions │ ├── Minimizing_Palindromic_Partitions.txt │ └── Solutions │ │ └── README.md ├── Palindrome_Validation_for_Strings │ ├── Palindrome_Validation_for_Strings.txt │ └── Solutions │ │ └── README.md ├── Pangram_Verification │ ├── Pangram_Verification.txt │ └── Solutions │ │ └── README.md ├── Recursive_String_Reversal │ ├── Recursive_String_Reversal.txt │ └── Solutions │ │ └── README.md ├── Reversing_Words_in_a_Sentence_Without_Libraries │ ├── Reversing_Words_in_a_Sentence_Without_Libraries.txt │ └── Solutions │ │ └── README.md ├── String-to-Integer_Conversion_Without_Built-in_Functions │ ├── Solutions │ │ ├── README.md │ │ └── main.c │ └── String-to-Integer_Conversion_Without_Built-in_Functions.txt ├── Validating_Balanced_Parentheses_in_a_String │ ├── Solutions │ │ └── README.md │ └── Validating_Balanced_Parentheses_in_a_String.txt ├── Verifying_Numeric-only_Characters_in_a_String │ ├── Solutions │ │ └── README.md │ └── Verifying_Numeric-only_Characters_in_a_String.txt └── Verifying_String_Rotations │ ├── Solutions │ └── README.md │ └── Verifying_String_Rotations.txt └── Structures_and_Unions ├── 32bit_value_access ├── 32bit_value_access.txt └── Solution │ ├── README.md │ └── main.c ├── 3D_point_distance ├── 3D_point_distance.txt └── Solution │ ├── README.md │ └── main.c ├── 4byte_value_conversion ├── 4byte_value_conversion.txt └── Solution │ └── README.md ├── IP_address_conversion ├── IP_address_conversion.txt └── Solution │ └── README.md ├── IP_address_representation ├── IP_address_representation.txt └── Solution │ └── README.md ├── book_price_discount ├── Solution │ ├── README.md │ └── main.c └── book_price_discount.txt ├── color_RGB_CMYK ├── Solution │ └── README.md └── color_RGB_CMYK.txt ├── command_parsing ├── Solution │ └── README.md └── command_parsing.txt ├── complex_number_operations ├── Solution │ ├── README.md │ └── main.c └── complex_number_operations.txt ├── data_packet_serialization ├── Solution │ └── README.md └── data_packet_serialization.txt ├── date_difference ├── Solution │ └── README.md └── date_difference.txt ├── device_config_bitfields ├── Solution │ └── README.md └── device_config_bitfields.txt ├── employee_address ├── Solution │ ├── README.md │ └── main.c └── employee_address.txt ├── endianness_conversion ├── Solution │ └── README.md └── endianness_conversion.txt ├── error_code_representation ├── Solution │ └── README.md └── error_code_representation.txt ├── file_attributes ├── Solution │ └── README.md └── file_attributes.txt ├── library_database ├── Solution │ └── README.md └── library_database.txt ├── menu_item_function_pointer ├── Solution │ └── README.md └── menu_item_function_pointer.txt ├── network_packet_type ├── Solution │ └── README.md └── network_packet_type.txt ├── structure_memory_optimization ├── Solution │ └── README.md └── structure_memory_optimization.txt ├── student_avg_marks ├── Solution │ ├── README.md │ └── main.c └── student_avg_marks.txt ├── student_linked_list ├── Solution │ └── README.md └── student_linked_list.txt ├── time_operations ├── Solution │ └── README.md └── time_operations.txt ├── variable_data_type_array ├── Solution │ └── README.md └── variable_data_type_array.txt └── vehicle_extended_structure ├── Solution └── README.md └── vehicle_extended_structure.txt /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [] 7 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.errorSquiggles": "disabled" 3 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: gcc.exe build active file", 6 | "command": "C:\\msys64\\ucrt64\\bin\\gcc.exe", 7 | "args": [ 8 | "-fdiagnostics-color=always", 9 | "-g", 10 | "${file}", 11 | "-o", 12 | "${fileDirname}\\${fileBasenameNoExtension}.exe" 13 | ], 14 | "options": { 15 | "cwd": "${fileDirname}" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Arrays/Array_Intersection_Calculator/Array_Intersection_Calculator.txt: -------------------------------------------------------------------------------- 1 | Determine the intersection of two integer arrays. 2 | 3 | WTD: Compare every element of the two arrays, listing down the common integers that appear in both. 4 | 5 | (e.g.: I/P: [1,2,4,5,6], [2,3,5,7], O/P: [2,5]) -------------------------------------------------------------------------------- /Arrays/Array_Intersection_Calculator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Array_Intersection_Calculator/Solution/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void findIntersection(int arr1[], int arr2[], int len1, int len2) { 4 | printf("Intersection of the two arrays: [ "); 5 | for (int i = 0; i < len1; i++) { 6 | for (int j = 0; j < len2; j++) { 7 | if (arr1[i] == arr2[j]) { 8 | printf("%d ", arr1[i]); 9 | break; // Break once we find a match to avoid duplicates 10 | } 11 | } 12 | } 13 | printf("]\n"); 14 | } 15 | 16 | int main() { 17 | int arr1[] = {1, 2, 4, 5, 6}; 18 | int arr2[] = {2, 3, 5, 7}; 19 | int len1 = sizeof(arr1) / sizeof(arr1[0]); 20 | int len2 = sizeof(arr2) / sizeof(arr2[0]); 21 | 22 | findIntersection(arr1, arr2, len1, len2); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Arrays/Array_Intersection_Calculator/Solution/main.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/T-Yashwanth-Naidu/C-Programming-Questions/05f2befc36689db295020398248f252ca930daee/Arrays/Array_Intersection_Calculator/Solution/main.exe -------------------------------------------------------------------------------- /Arrays/Array_Intersection_Calculator/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/T-Yashwanth-Naidu/C-Programming-Questions/05f2befc36689db295020398248f252ca930daee/Arrays/Array_Intersection_Calculator/a.out -------------------------------------------------------------------------------- /Arrays/Array_Leaders_Finder/Array_Leaders_Finder.txt: -------------------------------------------------------------------------------- 1 | Compute the leaders in an array. 2 | 3 | WTD: Traverse the array from right to left, finding numbers that remain the largest compared to all numbers on their right. 4 | 5 | (e.g.: I/P: [16,17,4,3,5,2], O/P: [17,5,2]) -------------------------------------------------------------------------------- /Arrays/Array_Leaders_Finder/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Array_Leaders_Finder/Solution/main.c: -------------------------------------------------------------------------------- 1 | /* Compute the leaders in an array. 2 | 3 | WTD: Traverse the array from right to left, finding numbers that remain the largest compared to all numbers on their right. 4 | 5 | (e.g.: I/P: [16,17,4,3,5,2], O/P: [17,5,2]) */ 6 | 7 | #include 8 | 9 | void find_leaders(int arr[], int length){ 10 | 11 | int leader = arr[length-1]; // creating var to store the largest number 12 | printf("%d\t",leader); 13 | 14 | //traversing from right to left and comparing 15 | for(int i=length-2;i>0;i--){ 16 | if(arr[i]>leader){ 17 | leader = arr[i]; 18 | printf("%d\t",leader); 19 | } 20 | } 21 | } 22 | 23 | int main() 24 | { 25 | //input array 26 | int arr[] = {16,17,4,3,5,2}; 27 | int length = sizeof(arr)/sizeof(arr[0]); //no. of elements in the array 28 | 29 | find_leaders(arr,length); 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /Arrays/Array_Leaders_Finder/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/T-Yashwanth-Naidu/C-Programming-Questions/05f2befc36689db295020398248f252ca930daee/Arrays/Array_Leaders_Finder/a.out -------------------------------------------------------------------------------- /Arrays/Array_Leaders_Finder/sid_solution.c: -------------------------------------------------------------------------------- 1 | #include 2 | int arrayLeaderfinder(int* a,int l) 3 | { 4 | int greatest; 5 | for(int i=0;ia[i+1]) 8 | { 9 | greatest = a[i]; 10 | } 11 | } 12 | return greatest; 13 | 14 | } 15 | 16 | void main() 17 | { 18 | int arr1[] = {2,6,1,4,5}; 19 | int len = sizeof(arr1)/sizeof(arr1[0]); 20 | printf("The greatest number in the array is %d ",arrayLeaderfinder(arr1,len)); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Arrays/Array_Product_Excluding_Self_Calculator/Array_Product_Excluding_Self_Calculator.txt: -------------------------------------------------------------------------------- 1 | Compute the product of an array except self. 2 | 3 | WTD: For every index in the array, calculate the product of all numbers except for the number at that index. 4 | 5 | (e.g.: I/P: [1,2,3,4], O/P: [24,12,8,6]) -------------------------------------------------------------------------------- /Arrays/Array_Product_Excluding_Self_Calculator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Array_Right_Rotator/Array_Right_Rotator.txt: -------------------------------------------------------------------------------- 1 | Rotate an array to the right by k steps. 2 | 3 | WTD: Modify the array by moving its elements to the right, wrapping them around when they reach the end, for a specified number of steps. 4 | 5 | (e.g.: I/P: [1,2,3,4,5], k=2, O/P: [4,5,1,2,3] ) -------------------------------------------------------------------------------- /Arrays/Array_Right_Rotator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Divisible_Sum_Pairs_Checker/Divisible_Sum_Pairs_Checker.txt: -------------------------------------------------------------------------------- 1 | Find if an array can be divided into pairs whose sum is divisible by k. 2 | 3 | WTD: Examine the array to see if it can be segmented into pairs such that the sum of each pair's numbers is divisible by a specific number, k. 4 | 5 | (e.g.: I/P: [9, 7, 5, -3], k=6, O/P: True) -------------------------------------------------------------------------------- /Arrays/Divisible_Sum_Pairs_Checker/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Duplicate_Number_Detector/Duplicate_Number_Detector.txt: -------------------------------------------------------------------------------- 1 | Find the duplicate number on a given integer array. 2 | 3 | WTD: Inspect the provided array. Determine if there's any integer that appears more frequently than it should, signifying a duplicate. -------------------------------------------------------------------------------- /Arrays/Duplicate_Number_Detector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Duplicate_Remover_without_Libraries/Duplicate_Remover_without_Libraries.txt: -------------------------------------------------------------------------------- 1 | Remove duplicates from an array without using any library. 2 | 3 | WTD: Navigate through the array, identifying and removing any repetitive occurrences of numbers, ensuring each number appears only once. 4 | 5 | (e.g.: I/P: [1,1,2,2,3,4,4], O/P: [1,2,3,4]) -------------------------------------------------------------------------------- /Arrays/Duplicate_Remover_without_Libraries/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Equilibrium_Index_Finder/Equilibrium_Index_Finder.txt: -------------------------------------------------------------------------------- 1 | Find the equilibrium index of an array (where sum of elements on the left is equal to sum on the right). 2 | 3 | WTD: Examine the array to find an index where the sum of all elements to its left is equal to the sum of all elements to its right. 4 | 5 | (e.g.: I/P: [-7, 1, 5, 2, -4, 3, 0], O/P: 3) -------------------------------------------------------------------------------- /Arrays/Equilibrium_Index_Finder/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Kth_Max-Min_Element_Retriever/Kth_Max-Min_Element_Retriever.txt: -------------------------------------------------------------------------------- 1 | Find the "Kth" max and min element of an array. 2 | 3 | WTD: Sort the array and retrieve the kth largest and kth smallest numbers. 4 | 5 | (e.g.: I/P: [7, 10, 4, 3, 20, 15], K=3, O/P: 7 ) 6 | -------------------------------------------------------------------------------- /Arrays/Kth_Max-Min_Element_Retriever/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Longest_Consecutive_Subsequence_Locator/Longest_Consecutive_Subsequence_Locator.txt: -------------------------------------------------------------------------------- 1 | Find the longest consecutive subsequence in an array. 2 | 3 | WTD: Examine the array to find the longest stretch of numbers that appear in increasing consecutive order. 4 | 5 | (e.g.: I/P: [1, 9, 3, 10, 4, 20, 2], O/P: [1, 2, 3, 4] ) 6 | -------------------------------------------------------------------------------- /Arrays/Longest_Consecutive_Subsequence_Locator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Majority_Element_Identifier/Majority_Element_Identifier.txt: -------------------------------------------------------------------------------- 1 | Find the majority element in an array (appears more than n/2 times). 2 | 3 | WTD: Traverse the array and maintain a count of each number. Identify if there's any number that appears more than half the length of the array. 4 | 5 | (e.g.: I/P: [3,3,4,2,4,4,2,4,4], O/P: 4 ) -------------------------------------------------------------------------------- /Arrays/Majority_Element_Identifier/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Max-Min_Finder_in_an_Unsorted_Array/Max-Min_Finder_in_an_Unsorted_Array.txt: -------------------------------------------------------------------------------- 1 | Find the largest and smallest number in an unsorted integer array. 2 | 3 | WTD: Navigate through the elements of the unsorted array, continuously updating the largest and smallest values found to identify the extremities in the array. 4 | 5 | (e.g.: I/P: [34, 15, 88, 2], O/P: Max: 88, Min: 2 ) -------------------------------------------------------------------------------- /Arrays/Max-Min_Finder_in_an_Unsorted_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Minimum_Sum_Subarray_Finder/Minimum_Sum_Subarray_Finder.txt: -------------------------------------------------------------------------------- 1 | Find the subarray with the least sum. 2 | 3 | WTD: Investigate all possible subarrays of the given array, finding the one with the smallest sum. 4 | 5 | (e.g.: I/P: [3,1,-4,2,0], O/P: -4) -------------------------------------------------------------------------------- /Arrays/Minimum_Sum_Subarray_Finder/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Missing_Number_Finder_in_a_1-to-500_Sequence/Missing_Number_Finder_in_a_1-to-500_Sequence.txt: -------------------------------------------------------------------------------- 1 | Find the missing number in a given integer array of 1 to 500. 2 | 3 | WTD: Examine an array expected to contain consecutive integers from 1 to 500. Identify any integer that is missing from this sequence. 4 | 5 | (e.g.: I/P: [1,2,4,5], O/P: 3) -------------------------------------------------------------------------------- /Arrays/Missing_Number_Finder_in_a_1-to-500_Sequence/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Multiple_Duplicates_Identifier/Multiple_Duplicates_Identifier.txt: -------------------------------------------------------------------------------- 1 | Find duplicate numbers in an array if it contains multiple duplicates. 2 | 3 | WTD: Examine the array to identify numbers that appear more than once. Compile a list of these repetitive numbers. 4 | 5 | (e.g.: I/P: [4,3,2,7,8,2,3,1], O/P: [2,3] ) -------------------------------------------------------------------------------- /Arrays/Multiple_Duplicates_Identifier/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Occurrence_Counter_in_a_Sorted_Array/Occurrence_Counter_in_a_Sorted_Array.txt: -------------------------------------------------------------------------------- 1 | Count occurrences of a number in a sorted array. 2 | 3 | WTD: For a given number and a sorted array, iterate through the array to count the number of times that particular number appears. 4 | 5 | (e.g.: I/P: [1, 2, 2, 2, 3], 2, O/P: 3 ) -------------------------------------------------------------------------------- /Arrays/Occurrence_Counter_in_a_Sorted_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Peak_Element_Identifier/Peak_Element_Identifier.txt: -------------------------------------------------------------------------------- 1 | Find the peak element in an array (greater than or equal to its neighbors). 2 | 3 | WTD: Scrutinize the array to find an element that is both larger than its predecessor and its successor. 4 | 5 | (e.g.: I/P: [1, 3, 20, 4, 1, 0], O/P: 20 ) -------------------------------------------------------------------------------- /Arrays/Peak_Element_Identifier/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Positive-Negative_Rearranger/Positive-Negative_Rearranger.txt: -------------------------------------------------------------------------------- 1 | Rearrange positive and negative numbers in an array. 2 | 3 | WTD: Sort the array such that all the positive numbers appear before the negative ones, while maintaining their original sequence. 4 | 5 | (e.g.: I/P: [-1, 2, -3, 4, 5, 6, -7, 8, 9], O/P: [4,-3,5,-1,6,-7,2,8,9] ) -------------------------------------------------------------------------------- /Arrays/Positive-Negative_Rearranger/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Quicksort_Array_Sorter/Quicksort_Array_Sorter.txt: -------------------------------------------------------------------------------- 1 | Sort an Array using quick sort algorithm 2 | 3 | WTD: Implement the quicksort sorting technique on the provided array to rearrange its elements in ascending order. 4 | 5 | (e.g.: I/P: [64, 34, 25, 12, 22, 11, 90], O/P: [11, 12, 22, 25, 34, 64, 90] ) -------------------------------------------------------------------------------- /Arrays/Quicksort_Array_Sorter/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Self-Referential_Array_Transformer/Self-Referential_Array_Transformer.txt: -------------------------------------------------------------------------------- 1 | Rearrange array such that arr[i] becomes arr[arr[i]]. 2 | 3 | WTD: Transform the array such that the number at each index corresponds to the number found at the index from the original array specified by the current number. 4 | 5 | (e.g.: I/P: [0, 1, 2, 3], O/P: [0, 1, 2, 3]) 6 | -------------------------------------------------------------------------------- /Arrays/Self-Referential_Array_Transformer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Sorted_Arrays_Merger/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Sorted_Arrays_Merger/Sorted_Arrays_Merger.txt: -------------------------------------------------------------------------------- 1 | Merge two sorted arrays to produce one sorted array. 2 | 3 | WTD: Sequentially compare the elements of two sorted arrays, combining them into a single array that remains sorted. 4 | 5 | (e.g.: I/P: [1,3,5], [2,4,6], O/P: [1,2,3,4,5,6] ) 6 | -------------------------------------------------------------------------------- /Arrays/Target_Sum_Pairs_Locator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Target_Sum_Pairs_Locator/Target_Sum_Pairs_Locator.txt: -------------------------------------------------------------------------------- 1 | Find all pairs of an integer array whose sum is equal to a given number. 2 | 3 | WTD: Explore combinations of integer pairs in the array. Check if the sum of any of these pairs matches a specified target number. 4 | 5 | (e.g.: I/P: [2,4,3,5,6,-2,4,7,8,9], Sum: 7, O/P: [2,5],[4,3] ) -------------------------------------------------------------------------------- /Arrays/Two_Repeating_Elements_Finder/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Two_Repeating_Elements_Finder/Two_Repeating_Elements_Finder.txt: -------------------------------------------------------------------------------- 1 | Find the two repeating elements in a given array. 2 | 3 | WTD: Investigate the array and find two numbers that each appear more than once. 4 | 5 | (e.g.: I/P: [4, 2, 4, 5, 2, 3, 1], O/P: [4,2] ) -------------------------------------------------------------------------------- /Arrays/Zero-Mover_to_the_Left/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Zero-Mover_to_the_Left/Zero-Mover_to_the_Left.txt: -------------------------------------------------------------------------------- 1 | Move all zeros to the left of an array while maintaining the order of other numbers. 2 | 3 | WTD: Reorder the array by moving all zero values to the leftmost positions while ensuring the relative order of the non-zero numbers remains unchanged. 4 | 5 | (e.g.: I/P: [1,2,0,4,3,0,5,0], O/P: [0,0,0,1,2,4,3,5] ) -------------------------------------------------------------------------------- /Arrays/Zero_Sum_Subarray_Detector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Arrays/Zero_Sum_Subarray_Detector/Zero_Sum_Subarray_Detector.txt: -------------------------------------------------------------------------------- 1 | Find if there's a subarray with zero sum. 2 | 3 | WTD: Explore the array's subarrays (subsets of consecutive elements) to determine if there exists any subarray that sums up to zero. 4 | 5 | (e.g.: I/P: [4, 2, -3, 1, 6], O/P: True ) -------------------------------------------------------------------------------- /Bit_Manipulations/Calculate_a_power_b_Using_Bit_Manipulation/Calculate_a_power_b_Using_Bit_Manipulation.txt: -------------------------------------------------------------------------------- 1 | Write a function to calculate a^b Using Bit Manipulation : 2 | 3 | WTD: Given two integers a and b, calculate a^b using bitwise operations. Avoid using the power operator or any other arithmetic operations. 4 | 5 | (e.g.: I/P: 2, 3; O/P: 8) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Calculate_a_power_b_Using_Bit_Manipulation/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Calculate_a_power_b_Using_Bit_Manipulation/Solution/main.c: -------------------------------------------------------------------------------- 1 | /*Write a function to calculate a^b Using Bit Manipulation : 2 | 3 | WTD: Given two integers a and b, calculate a^b using bitwise operations. Avoid using the power operator or any other arithmetic operations. 4 | 5 | (e.g.: I/P: 2, 3; O/P: 8)*/ 6 | 7 | #include 8 | 9 | int main() 10 | { 11 | int a, b, result=1; 12 | 13 | scanf("%d, %d",&a,&b); 14 | 15 | while(b>0){ 16 | if(b&1){ 17 | result *= a; 18 | } 19 | a *= a; 20 | b >>= 1; 21 | } 22 | 23 | printf("%d",result); 24 | 25 | 26 | return 0; 27 | } -------------------------------------------------------------------------------- /Bit_Manipulations/Check_for_Alternate_Bits/Check_for_Alternate_Bits.txt: -------------------------------------------------------------------------------- 1 | Check for Alternate Bits. Write a function to check if bits in a given number are in alternate pattern. 2 | 3 | WTD: Given an integer, check if the bits in its binary representation alternate between 0 and 1. Use bitwise operations to traverse the bits and perform the check. 4 | 5 | (e.g.: I/P: 0b10101010; O/P: True) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Check_for_Alternate_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Check_for_Alternate_Bits/Solution/main.c: -------------------------------------------------------------------------------- 1 | /* Check for Alternate Bits. Write a function to check if bits in a given number are in alternate pattern. 2 | 3 | WTD: Given an integer, check if the bits in its binary representation alternate between 0 and 1. Use bitwise operations to traverse the bits and perform the check. 4 | 5 | (e.g.: I/P: 0b10101010; O/P: True) */ 6 | 7 | #include 8 | #include 9 | 10 | bool checkAltBits(int a) 11 | { 12 | //eg - 10101010 & (01010101) = 0 13 | // returns !(0) , i.e 1 (True) 14 | return !(a & (a>>1)); 15 | } 16 | 17 | int main() 18 | { 19 | int a; 20 | scanf("%u",&a); //inputting unsigned integer 21 | 22 | if(checkAltBits(a)) 23 | printf("True"); 24 | else 25 | printf("False"); 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Bit_Manipulations/Check_if_Binary_Representation_of_a_Number_is_Palindrome/Check_if_Binary_Representation_of_a_Number_is_Palindrome.txt: -------------------------------------------------------------------------------- 1 | Check if Binary Representation of a Number is Palindrome. Write a function to check if the binary representation of a number is a palindrome. 2 | 3 | WTD: For a given integer, determine whether its binary representation reads the same forwards and backwards. Use bitwise operations to extract each bit for the check. 4 | 5 | (e.g.: I/P: 9 (0b1001); O/P: True) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Check_if_Binary_Representation_of_a_Number_is_Palindrome/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Check_if_Number_is_Multiple_of_3/Check_if_Number_is_Multiple_of_3.txt: -------------------------------------------------------------------------------- 1 | Write a program to find whether a given number is a multiple of 3 using bit manipulation. 2 | 3 | WTD: For a given integer, determine if it is a multiple of 3 using only bitwise operations. Your function should return a boolean value. 4 | 5 | (e.g.: I/P: 9; O/P: True) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Check_if_Number_is_Multiple_of_3/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Clear_Bits_From_MSB_to_i/Clear_Bits_From_MSB_to_i.txt: -------------------------------------------------------------------------------- 1 | Write a function that clears all the bits from the most significant bit through i (inclusive) in a given number. 2 | 3 | WTD: You have an integer. Clear all the bits from the most significant bit to bit i (inclusive). Use bitwise operations to perform this action and return the modified integer. 4 | 5 | (e.g. :I/P: 0b11111111, i=3; O/P: 0b00001111) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Clear_Bits_From_MSB_to_i/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Convert_Decimal_to_Binary/Convert_Decimal_to_Binary.txt: -------------------------------------------------------------------------------- 1 | Write a function that converts a decimal number to its binary representation using bit manipulation. 2 | 3 | WTD: Given a decimal number, convert it into its binary representation using bitwise operations. Your function should return the binary string. 4 | 5 | (e.g.: I/P: 5; O/P: 0b101) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Convert_Decimal_to_Binary/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Count_Number_of_Flips_to_Convert_A_to_B/Count_Number_of_Flips_to_Convert_A_to_B.txt: -------------------------------------------------------------------------------- 1 | Count Number of Flips to Convert A to B. Implement a function that counts the number of flips required to convert integer A to integer B . 2 | 3 | WTD: You are given two integers A and B. Determine the number of bits you need to flip to convert A into B using bitwise operations. 4 | 5 | (e.g.: I/P: A=29 (0b11101), B=15 (0b01111); O/P: 2) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Count_Number_of_Flips_to_Convert_A_to_B/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Count_Set_Bits/Count_Set_Bits.txt: -------------------------------------------------------------------------------- 1 | Count Set Bits. Design a function that counts the number of set bits (1s) in an integer without looping. 2 | 3 | WTD: Given an integer, count the number of bits set to 1 in its binary representation. You need to achieve this without using any loops. Use bitwise operations to find the count efficiently. 4 | 5 | (e.g.: I/P: 0b11010110; O/P: 5) -------------------------------------------------------------------------------- /Bit_Manipulations/Count_Set_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Detecting_Power_of_Two/Detecting_Power_of_Two.txt: -------------------------------------------------------------------------------- 1 | Detecting Power of Two. Write a program to check if a given number is a power of two using bit manipulation. 2 | 3 | WTD: Given an integer, determine whether it is a power of 2 or not. Your solution should only use bitwise operations. Avoid using mathematical functions like logarithms or multiplication. 4 | 5 | (e.g.: I/P: 32; O/P: True) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Detecting_Power_of_Two/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Determine_if_Two_Integers_Have_Opposite_Signs/Determine_if_Two_Integers_Have_Opposite_Signs.txt: -------------------------------------------------------------------------------- 1 | Determine if Two Integers Have Opposite Signs. Write a function to determine if two integers have opposite signs using bit manipulation. 2 | 3 | WTD: You are given two integers. Use bitwise operations to determine if they have opposite signs. Your function should return a boolean value. 4 | 5 | (e.g.: I/P: -4, 5; O/P: True) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Determine_if_Two_Integers_Have_Opposite_Signs/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Extract_n_Bits/Extract_n_Bits.txt: -------------------------------------------------------------------------------- 1 | Extract n Bits. Design a function to extract n bits from a byte starting from a given position p . 2 | 3 | WTD: You have a byte, and you need to extract n bits starting from a given position p. Use bitwise operations to isolate these n bits and return them as an integer. 4 | 5 | (e.g.: I/P: Byte: 0b10101100, n=3, p=2; O/P: 0b101 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Extract_n_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Find_Parity_of_a_Number/Find_Parity_of_a_Number.txt: -------------------------------------------------------------------------------- 1 | Find Parity of a Number. Implement a function to check if the number of 1s in the binary representation of a given number is even or odd. 2 | 3 | WTD: Given an integer, find the parity of its binary representation. Use bitwise operations to count the number of bits set to 1 and determine if it's odd or even. 4 | 5 | (e.g.: I/P: 7 (0b0111); O/P: Odd) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Find_Parity_of_a_Number/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Find_Two_Unique_Numbers_in_Array/Find_Two_Unique_Numbers_in_Array.txt: -------------------------------------------------------------------------------- 1 | Given an array where every element appears twice except for two numbers. Find those two numbers using bitwise operations. 2 | 3 | WTD: You are given an array where every element appears exactly twice except for two numbers. Use bitwise operations to find these two unique numbers. 4 | 5 | (e.g.: I/P: [4,1,2,1,2,5]; O/P: 4, 5) 6 | 7 | -------------------------------------------------------------------------------- /Bit_Manipulations/Find_Two_Unique_Numbers_in_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Find_a_Unique_Number_in_an_Array/Find_a_Unique_Number_in_an_Array.txt: -------------------------------------------------------------------------------- 1 | Find a Unique Number in an Array. Given an array where all numbers appear three times except for one, which appears just once. Find the unique number using bitwise operations. 2 | 3 | WTD: Given an array where each number appears exactly three times except for one number, find the unique number that appears just once. Use bitwise operations to find this unique number. 4 | 5 | (e.g.: I/P: [6,1,3,3,3,6,6]; O/P: 1) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Find_a_Unique_Number_in_an_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Generate_All_Possible_Combinations_of_n_Bits/Generate_All_Possible_Combinations_of_n_Bits.txt: -------------------------------------------------------------------------------- 1 | Generate All Possible Combinations of n Bits. Design a program that generates all the possible combinations of n bits. 2 | 3 | WTD: For a given integer n, generate all possible binary sequences of length n using bitwise operations. The output should be a list of all these combinations. 4 | 5 | (e.g.: I/P: n=3; O/P: 000, 001, 010, 011, 100, 101, 110, 111) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Generate_All_Possible_Combinations_of_n_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Implement_Bitwise_Right_Shift/Implement_Bitwise_Right_Shift.txt: -------------------------------------------------------------------------------- 1 | Implement Bitwise Right Shift. Implement a function to perform a bitwise right shift without using the '>>' operator. 2 | 3 | WTD: Given an integer and a shift count, implement the bitwise right shift operation without using the '>>' operator. Your function should return the integer after shifting its bits to the right. 4 | 5 | (e.g.: I/P: 0b1101, 2; O/P: 0b0011) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Implement_Bitwise_Right_Shift/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Implement_XOR_Without_Using_XOR_Operator/Implement_XOR_Without_Using_XOR_Operator.txt: -------------------------------------------------------------------------------- 1 | Implement XOR Without Using XOR Operator. Design a program to perform XOR operation on two numbers without using the XOR operator. 2 | 3 | WTD: You have two integers. Implement the XOR operation without using the XOR operator. Use bitwise operations to calculate the result. 4 | 5 | (e.g.: I/P: 5, 3; O/P: 6) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Implement_XOR_Without_Using_XOR_Operator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Isolate_the_Rightmost_Set_Bit/Isolate_the_Rightmost_Set_Bit.txt: -------------------------------------------------------------------------------- 1 | Isolate the Rightmost Set Bit. Write a function to isolate the rightmost set bit of an integer. 2 | 3 | WTD: Given an integer, isolate the rightmost bit set to 1 in its binary representation. Use bitwise operations to find this bit while setting all other bits to 0. 4 | 5 | (e.g.: I/P: 0b10100000; O/P: 0b00100000) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Isolate_the_Rightmost_Set_Bit/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Mask_Certain_Bits/Mask_Certain_Bits.txt: -------------------------------------------------------------------------------- 1 | Mask Certain Bits. Implement a function that masks (sets to zero) all bits except for the first n bits of an integer. 2 | 3 | WTD: Given an integer, mask (set to zero) all but the first n bits. Use bitwise operations to perform this masking and return the resulting integer. 4 | 5 | (e.g.: I/P: 0b10101111, n=4; O/P: 0b00001111) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Mask_Certain_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Reverse_Bits_in_a_Byte/Reverse_Bits_in_a_Byte.txt: -------------------------------------------------------------------------------- 1 | Reverse Bits in a Byte. Implement a function to reverse the bits in a byte. 2 | 3 | WTD: You have an 8-bit byte. Reverse the order of its bits using bitwise operations. For example, if the input byte is 0b11001001, the output should be 0b10010011. 4 | 5 | (e.g.: I/P: 0b11001001; O/P: 0b10010011) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Reverse_Bits_in_a_Byte/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Rotate_Bits/Rotate_Bits.txt: -------------------------------------------------------------------------------- 1 | Rotate Bits. Design a program to rotate bits of a number to the left by k positions. 2 | 3 | WTD: You have an integer and a number k. Rotate the bits of the integer to the left by k positions using bitwise operations. 4 | 5 | (e.g.: I/P: 0b10110011, k=3; O/P: 0b10011101) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Rotate_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Set_Bits_Without_Using_Arithmetic_Operations/Set_Bits_Without_Using_Arithmetic_Operations.txt: -------------------------------------------------------------------------------- 1 | Set Bits Without Using Arithmetic Operations. Implement a function that sets the first n bits of a byte to 1. 2 | 3 | WTD: You are given an integer n. Use bitwise operations to set the first n bits of an 8-bit number to 1 while setting the remaining bits to 0. You cannot use arithmetic operations like addition or multiplication. 4 | 5 | (e.g.: I/P: n=4; O/P: 0b11110000) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Set_Bits_Without_Using_Arithmetic_Operations/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Single_Number_in_Array/Single_Number_in_Array.txt: -------------------------------------------------------------------------------- 1 | Single Number in Array. Given an array where every element appears twice except for one, find the element using bitwise operations. 2 | 3 | WTD: You are given an array where each element appears exactly twice except for one element, which appears only once. Find that unique element using bitwise operations. Do this in constant space. 4 | 5 | (e.g.: I/P: [4,1,2,1,2]; O/P: 4) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Single_Number_in_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Swap_Odd_and_Even_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Swap_Odd_and_Even_Bits/Swap_Odd_and_Even_Bits.txt: -------------------------------------------------------------------------------- 1 | Swap Odd and Even Bits. Implement a function to swap odd and even bits in an integer. 2 | 3 | WTD: For a given integer, swap its odd and even bits. Bit 1 should swap with Bit 2, Bit 3 with Bit 4, and so on. Use bitwise operations to perform the swapping. 4 | 5 | (e.g.: I/P: 0b10101010; O/P: 0b01010101) 6 | -------------------------------------------------------------------------------- /Bit_Manipulations/Toggle_3rd_and_5th_Bits/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Bit_Manipulations/Toggle_3rd_and_5th_Bits/Toggle_3rd_and_5th_Bits.txt: -------------------------------------------------------------------------------- 1 | Write a function that toggles the 3rd and 5th bits of an 8-bit number. 2 | 3 | WTD: You have an 8-bit number. Your task is to toggle the bits at positions 3 and 5 (counting from the least significant bit). Use bitwise operations to modify these specific bits while leaving the others unchanged. 4 | 5 | (e.g.: I/P: 0b10100101; O/P: 0b10000101) 6 | -------------------------------------------------------------------------------- /Linked_List/Add_Numbers_Represented_by_Lists/Add_Numbers_Represented_by_Lists.txt: -------------------------------------------------------------------------------- 1 | Add two numbers represented by linked lists. 2 | 3 | WTD: Traverse both lists, sum the corresponding nodes, and manage the carry. 4 | 5 | (e.g.: I/P: 2->4 & 5->6 (24 + 56); O/P: 8->0) 6 | -------------------------------------------------------------------------------- /Linked_List/Add_Numbers_Represented_by_Lists/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Clone_Linked_List_With_Random_Pointer/Clone_Linked_List_With_Random_Pointer.txt: -------------------------------------------------------------------------------- 1 | Clone a linked list with next and random pointer. 2 | 3 | WTD: Create a deep copy of the linked list including the random pointers using a hash table to map original nodes to their copies. 4 | 5 | (e.g.: I/P: 1->2->3 (random pointers set randomly); O/P: Cloned list with same structure and random pointers) 6 | -------------------------------------------------------------------------------- /Linked_List/Clone_Linked_List_With_Random_Pointer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Common_Ancestor_in_Binary_Tree_Doubly_Linked_List/Common_Ancestor_in_Binary_Tree_Doubly_Linked_List.txt: -------------------------------------------------------------------------------- 1 | Find the common ancestor of two nodes in a binary tree represented as a doubly linked list. 2 | 3 | WTD: Traverse the binary tree represented as a doubly linked list and find the common ancestor of the given two nodes. Utilize parent pointers in the doubly linked list to backtrack. 4 | 5 | (e.g.: I/P: Nodes 6 and 9 in Binary Tree 4->5->6->7->8->9; O/P: 7) 6 | -------------------------------------------------------------------------------- /Linked_List/Common_Ancestor_in_Binary_Tree_Doubly_Linked_List/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Compare_Strings_As_Linked_Lists/Compare_Strings_As_Linked_Lists.txt: -------------------------------------------------------------------------------- 1 | Compare two strings represented as linked lists. 2 | 3 | WTD: Traverse both lists, comparing each node's value. If they are equal throughout, the lists are equal. 4 | 5 | (e.g.: I/P: 'a'->'b'->'c' & 'a'->'b'->'c'; O/P: Equal) 6 | -------------------------------------------------------------------------------- /Linked_List/Compare_Strings_As_Linked_Lists/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Convert_Binary_Number_to_Integer/Convert_Binary_Number_to_Integer.txt: -------------------------------------------------------------------------------- 1 | Convert a binary number represented by a linked list to an integer. 2 | 3 | WTD: Traverse the linked list and convert the binary number represented by the linked list nodes to an integer. Use bit manipulation for the conversion. 4 | 5 | (e.g.: I/P: 1->0->1; O/P: 5) 6 | -------------------------------------------------------------------------------- /Linked_List/Convert_Binary_Number_to_Integer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Delete_Alternate_Nodes/Delete_Alternate_Nodes.txt: -------------------------------------------------------------------------------- 1 | Delete alternate nodes of a linked list. 2 | 3 | WTD: Traverse the list and remove every alternate node. 4 | 5 | (e.g.: I/P: 1->2->3->4; O/P: 1->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Delete_Alternate_Nodes/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Detect_And_Remove_Loop/Detect_And_Remove_Loop.txt: -------------------------------------------------------------------------------- 1 | Detect and remove loop in a linked list. 2 | 3 | WTD: Use Floyd's algorithm to detect the loop and then remove it by setting the next pointer of the last node in the loop to NULL. 4 | 5 | (e.g.: I/P: 1->2->3 (3 points back to 1); O/P: 1->2->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Detect_And_Remove_Loop/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Detect_Cycle_in_LinkedList/Detect_Cycle_in_LinkedList.txt: -------------------------------------------------------------------------------- 1 | Check if a given linked list contains a cycle and what would be the starting node? 2 | 3 | WTD: Use Floyd’s cycle-finding algorithm to detect the cycle and then find its starting node. 4 | 5 | (e.g.: I/P: 1->2->3 (3 points back to 1); O/P: True) 6 | -------------------------------------------------------------------------------- /Linked_List/Detect_Cycle_in_LinkedList/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Find_Middle_Element/Find_Middle_Element.txt: -------------------------------------------------------------------------------- 1 | Find Middle element of a singly linked list in one pass. 2 | 3 | WTD: Use two pointers, one moving twice as fast as the other, to find the middle element in a single pass. 4 | 5 | (e.g.: I/P: 1->2->3->4->5; O/P: 3) 6 | -------------------------------------------------------------------------------- /Linked_List/Find_Middle_Element/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Find_Nth_Node_From_End/Find_Nth_Node_From_End.txt: -------------------------------------------------------------------------------- 1 | Find nth node from end of a singly linked list. 2 | 3 | WTD: Use two pointers, move one n nodes ahead, then move both until the first one reaches the end. 4 | 5 | (e.g.: I/P: 1->2->3->4 (n=2); O/P: 3) 6 | -------------------------------------------------------------------------------- /Linked_List/Find_Nth_Node_From_End/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Flatten_Multi_Level_Linked_List/Flatten_Multi_Level_Linked_List.txt: -------------------------------------------------------------------------------- 1 | Flatten a multi-level linked list. 2 | 3 | WTD: Use a stack or recursion to flatten the list so that all nodes are at the same level. 4 | 5 | (e.g.: I/P: 1->2->3 (2 has child 4->5); O/P: 1->2->4->5->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Flatten_Multi_Level_Linked_List/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Intersection_Point_Two_Lists/Intersection_Point_Two_Lists.txt: -------------------------------------------------------------------------------- 1 | Intersection point of two linked lists. 2 | 3 | WTD: Use two pointers, one for each list, and traverse to find the intersection point. 4 | 5 | (e.g.: I/P: 1->2->3 & 4->5->3; O/P: 3) 6 | -------------------------------------------------------------------------------- /Linked_List/Intersection_Point_Two_Lists/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Length_of_Linked_List/Length_of_Linked_List.txt: -------------------------------------------------------------------------------- 1 | Find the length of a singly linked list. 2 | 3 | WTD: Traverse the list from head to tail, incrementing a counter to find its length. 4 | 5 | (e.g.: I/P: 1->2->3->4; O/P: 4) 6 | -------------------------------------------------------------------------------- /Linked_List/Length_of_Linked_List/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Linked_List_Is_Palindrome/Linked_List_Is_Palindrome.txt: -------------------------------------------------------------------------------- 1 | Determine if a linked list is a palindrome. 2 | 3 | WTD: Use a slow and fast pointer to find the middle of the list. Reverse the second half and compare it with the first half to determine if the linked list is a palindrome. 4 | 5 | (e.g.: I/P: 1->2->2->1; O/P: True) 6 | -------------------------------------------------------------------------------- /Linked_List/Linked_List_Is_Palindrome/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Merge_Sort_on_Linked_List/Merge_Sort_on_Linked_List.txt: -------------------------------------------------------------------------------- 1 | Merge sort on a linked list. 2 | 3 | WTD: Implement the Merge Sort algorithm on a linked list, splitting the list into halves and merging them back in sorted order. 4 | 5 | (e.g.: I/P: 3->1->2; O/P: 1->2->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Merge_Sort_on_Linked_List/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Merge_Two_Sorted_Lists/Merge_Two_Sorted_Lists.txt: -------------------------------------------------------------------------------- 1 | Merge two sorted linked lists. 2 | 3 | WTD: Use a temporary dummy node to hold the sorted list, compare each node and attach the smaller one to the dummy. 4 | 5 | (e.g.: I/P: 1->3->5 & 2->4->6; O/P: 1->2->3->4->5->6) 6 | -------------------------------------------------------------------------------- /Linked_List/Merge_Two_Sorted_Lists/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Move_Last_Element_To_Front/Move_Last_Element_To_Front.txt: -------------------------------------------------------------------------------- 1 | Move last element to the front of a given linked list. 2 | 3 | WTD: Find the last node and its previous node, change their pointers to move the last node to the front. 4 | 5 | (e.g.: I/P: 1->2->3->4; O/P: 4->1->2->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Move_Last_Element_To_Front/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Pairwise_Swap_Elements/Pairwise_Swap_Elements.txt: -------------------------------------------------------------------------------- 1 | Pairwise swap elements of a linked list. 2 | 3 | WTD: Swap every two adjacent nodes by adjusting their pointers. 4 | 5 | (e.g.: I/P: 1->2->3->4; O/P: 2->1->4->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Pairwise_Swap_Elements/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Partition_Linked_List_Around_Value/Partition_Linked_List_Around_Value.txt: -------------------------------------------------------------------------------- 1 | Partition a linked list around a given value. 2 | 3 | WTD: Traverse the linked list, creating two separate lists - one for values less than the partition value and another for values greater than or equal to the partition value. Finally, merge these lists. 4 | 5 | (e.g.: I/P: 1->4->3->2->5->2, Partition Value: 3; O/P: 1->2->2->4->3->5) 6 | -------------------------------------------------------------------------------- /Linked_List/Partition_Linked_List_Around_Value/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Remove_Duplicates_Unsorted/Remove_Duplicates_Unsorted.txt: -------------------------------------------------------------------------------- 1 | Remove duplicate nodes in an unsorted linked list. 2 | 3 | WTD: Use a hash table to record the occurrence of each node while traversing the list to remove duplicates. 4 | 5 | (e.g.: I/P: 1->2->2->3; O/P: 1->2->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Remove_Duplicates_Unsorted/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Remove_Nodes_of_Specific_Value/Remove_Nodes_of_Specific_Value.txt: -------------------------------------------------------------------------------- 1 | Remove all nodes in a linked list that have a specific value. 2 | 3 | WTD: Traverse the linked list and remove any node that has a value matching the specified value. Make sure to properly update the next pointers and free any removed nodes. 4 | 5 | (e.g.: I/P: 1->2->6->3->4->5->6, Value to Remove: 6; O/P: 1->2->3->4->5) 6 | -------------------------------------------------------------------------------- /Linked_List/Remove_Nodes_of_Specific_Value/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Reverse_Linked_List/Reverse_Linked_List.txt: -------------------------------------------------------------------------------- 1 | Reverse a linked list. 2 | 3 | WTD: Traverse the list while reversing the next pointers of each node. 4 | 5 | (e.g.: I/P: 1->2->3; O/P: 3->2->1) 6 | -------------------------------------------------------------------------------- /Linked_List/Reverse_Linked_List/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Reverse_Linked_List_No_Recursion/Reverse_Linked_List_No_Recursion.txt: -------------------------------------------------------------------------------- 1 | Reverse a singly linked list without recursion. 2 | 3 | WTD: Use iterative method to reverse the next pointers of each node. 4 | 5 | (e.g.: I/P: 1->2->3; O/P: 3->2->1) 6 | -------------------------------------------------------------------------------- /Linked_List/Reverse_Linked_List_No_Recursion/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Segregate_Even_Odd_Nodes/Segregate_Even_Odd_Nodes.txt: -------------------------------------------------------------------------------- 1 | Segregate even and odd nodes in a linked list. 2 | 3 | WTD: Use two pointers to rearrange nodes such that all even and odd elements are together. 4 | 5 | (e.g.: I/P: 1->2->3->4; O/P: 2->4->1->3) 6 | -------------------------------------------------------------------------------- /Linked_List/Segregate_Even_Odd_Nodes/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Sum_of_Linked_Lists_Using_Stack/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linked_List/Sum_of_Linked_Lists_Using_Stack/Sum_of_Linked_Lists_Using_Stack.txt: -------------------------------------------------------------------------------- 1 | Find sum of two linked list using stack. 2 | 3 | WTD: Use two stacks to hold the numbers from each list, then pop and sum them, storing the result in a new list. 4 | 5 | (e.g.: I/P: 2->4 & 5->6 (24 + 56); O/P: 8->0) 6 | -------------------------------------------------------------------------------- /Linux_Internals/CPU_Information_Fetcher/CPU_Information_Fetcher.txt: -------------------------------------------------------------------------------- 1 | CPU Information Fetcher 2 | 3 | WTD: Write a program to fetch and display CPU information from /proc/cpuinfo. Use file I/O to read the /proc/cpuinfo file and parse it. 4 | -------------------------------------------------------------------------------- /Linux_Internals/CPU_Information_Fetcher/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/CPU_Scheduling_Algorithm/CPU_Scheduling_Algorithm.txt: -------------------------------------------------------------------------------- 1 | CPU Scheduling Algorithm 2 | 3 | WTD: Implement a basic CPU scheduling algorithm like Round Robin. Use a queue to manage processes and simulate the CPU scheduler. 4 | 5 | (e.g.: I/P: Processes and burst times; O/P: Turnaround and waiting times) 6 | -------------------------------------------------------------------------------- /Linux_Internals/CPU_Scheduling_Algorithm/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Command_line_Argument_Parser/Command_line_Argument_Parser.txt: -------------------------------------------------------------------------------- 1 | Command-line Argument Parser 2 | 3 | WTD: Write a C program that takes various command-line options and arguments and prints them. Use the getopt() library function to parse command-line options and arguments. 4 | 5 | (e.g.: I/P: Command-line options and arguments; O/P: Parsed data) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Command_line_Argument_Parser/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Custom_Signal_Handling/Custom_Signal_Handling.txt: -------------------------------------------------------------------------------- 1 | Custom Signal Handling 2 | 3 | WTD: Write a program that custom handles signals like SIGINT and SIGTERM. Use signal() or sigaction() to catch and handle signals. 4 | 5 | (e.g.: I/P: Signal type; O/P: Custom message or action upon receiving signal) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Custom_Signal_Handling/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Custom_init_Process/Custom_init_Process.txt: -------------------------------------------------------------------------------- 1 | Custom init Process 2 | 3 | WTD: Write a custom init process to replace the default init for embedded Linux. Research how init works and write a C program that performs the necessary initialization steps. 4 | 5 | (e.g.: I/P: None; O/P: System booted with custom init) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Custom_init_Process/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Custom_malloc_free/Custom_malloc_free.txt: -------------------------------------------------------------------------------- 1 | Custom malloc() and free() 2 | 3 | WTD: Implement your own malloc() and free() functions. Use system calls like sbrk() to manage memory allocation. 4 | -------------------------------------------------------------------------------- /Linux_Internals/Custom_malloc_free/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Custom_ps_Command/Custom_ps_Command.txt: -------------------------------------------------------------------------------- 1 | Custom ps Command 2 | 3 | WTD: Implement a simplified version of the ps command to list the currently running processes. Read information from /proc to list the currently running processes. 4 | 5 | (e.g.: I/P: None; O/P: List of running processes) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Custom_ps_Command/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/File_Copy_Program/File_Copy_Program.txt: -------------------------------------------------------------------------------- 1 | File Copy Program 2 | 3 | WTD: Write a program that copies one file to another using low-level file operations. Use open(), read(), and write() system calls to perform the file copy. 4 | 5 | (e.g.: I/P: Source and destination file paths; O/P: Copy status) 6 | -------------------------------------------------------------------------------- /Linux_Internals/File_Copy_Program/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Filesystem_Traversal_opendir_readdir/Filesystem_Traversal_opendir_readdir.txt: -------------------------------------------------------------------------------- 1 | Filesystem Traversal using opendir and readdir 2 | 3 | WTD: Traverse a directory structure and print all filenames. Use opendir() and readdir() to read directories and their contents. 4 | 5 | (e.g.: I/P: Root directory; O/P: List of all files and directories) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Filesystem_Traversal_opendir_readdir/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_Priority_Inversion_Handling/Implement_Priority_Inversion_Handling.txt: -------------------------------------------------------------------------------- 1 | Implement Priority Inversion Handling 2 | 3 | WTD: Simulate Priority Inversion and implement a solution. Use threads with different priorities and mutexes to simulate and resolve priority inversion. 4 | 5 | (e.g.: I/P: None; O/P: Fixed Priority Inversion) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_Priority_Inversion_Handling/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_Simple_Shell/Implement_Simple_Shell.txt: -------------------------------------------------------------------------------- 1 | Implement a Simple Shell 2 | 3 | WTD: Create a minimal shell in C that can execute basic Linux commands like ls, cd, pwd, etc. Use system calls like fork() and exec() to spawn and execute commands. 4 | 5 | (e.g.: I/P: "ls -l"; O/P: Directory listing) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_Simple_Shell/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_chmod_Command/Implement_chmod_Command.txt: -------------------------------------------------------------------------------- 1 | Implement chmod Command 2 | 3 | WTD: Create a program to mimic the Linux chmod command for changing file permissions. Use the chmod() system call to change the file permissions. 4 | 5 | (e.g.: I/P: File path and permission code; O/P: Permission change status) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_chmod_Command/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_ping_Command/Implement_ping_Command.txt: -------------------------------------------------------------------------------- 1 | Implement ping Command 2 | 3 | WTD: Write a program to mimic the functionality of the ping command. Use raw sockets and ICMP protocol to implement the ping functionality. 4 | 5 | (e.g.: I/P: IP Address or hostname; O/P: Ping statistics) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_ping_Command/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_tail_Command/Implement_tail_Command.txt: -------------------------------------------------------------------------------- 1 | Implement tail Command 2 | 3 | WTD: Create a program to mimic the Linux tail command. Use file I/O operations to read the file in reverse and display lines. 4 | 5 | (e.g.: I/P: File path; O/P: Last 10 lines of the file) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_tail_Command/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_watch_Command/Implement_watch_Command.txt: -------------------------------------------------------------------------------- 1 | Implement watch Command 2 | 3 | WTD: Write a program to mimic the Linux watch command. Use system() or fork() and exec() to run the command at regular intervals. 4 | 5 | (e.g.: I/P: Command to run, time interval; O/P: Command output at intervals) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_watch_Command/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Implement_whois_Command/Implement_whois_Command.txt: -------------------------------------------------------------------------------- 1 | Implement whois Command 2 | 3 | WTD: Write a program to mimic the whois command functionality. Use socket programming to communicate with the whois server. 4 | 5 | (e.g.: I/P: Domain name; O/P: Whois record) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Implement_whois_Command/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Mutex_based_File_Access/Mutex_based_File_Access.txt: -------------------------------------------------------------------------------- 1 | Mutex-based File Access 2 | 3 | WTD: Write a multi-threaded program where each thread attempts to write to a file. Use mutexes to ensure that only one thread writes to the file at any given time. Use pthread_mutex_lock() to lock the file before each thread writes to it. 4 | 5 | (e.g.: I/P: Thread count; O/P: File with written data) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Mutex_based_File_Access/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Priority_Inversion_Problem/Priority_Inversion_Problem.txt: -------------------------------------------------------------------------------- 1 | Priority Inversion Problem 2 | 3 | WTD: Simulate the priority inversion problem and solve it using priority inheritance. Implement priority inheritance while using mutexes. 4 | 5 | (e.g.: I/P: Thread priorities; O/P: Execution order) 6 | 7 | 8 | -------------------------------------------------------------------------------- /Linux_Internals/Priority_Inversion_Problem/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Process_Forking_Waiting/Process_Forking_Waiting.txt: -------------------------------------------------------------------------------- 1 | Process Forking and Waiting 2 | 3 | WTD: Create a program that forks child processes and waits for them to complete. Use fork() to create child processes and wait() to wait for their completion. 4 | 5 | (e.g.: I/P: Number of child processes; O/P: Exit status of children) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Process_Forking_Waiting/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Semaphore_based_Producer_Consumer/Semaphore_based_Producer_Consumer.txt: -------------------------------------------------------------------------------- 1 | Semaphore-based Producer-Consumer 2 | 3 | WTD: Implement a producer-consumer problem using semaphores. Use POSIX semaphores and threads to implement the producer and consumer. 4 | 5 | (e.g.: I/P: Number of items to produce and consume; O/P: Order of production and consumption. ) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Semaphore_based_Producer_Consumer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Terminal_Multiplexer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Terminal_Multiplexer/Terminal_Multiplexer.txt: -------------------------------------------------------------------------------- 1 | Terminal Multiplexer 2 | 3 | WTD: Create a basic terminal multiplexer that allows switching between multiple shell instances. Use fork() and exec() to spawn new shells and terminal I/O to switch between them. 4 | 5 | (e.g.: I/P: Key commands; O/P: Switched terminal instance) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Thread_Creation_Synchronization/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Thread_Creation_Synchronization/Thread_Creation_Synchronization.txt: -------------------------------------------------------------------------------- 1 | Thread Creation and Synchronization 2 | 3 | WTD: Create multiple threads and synchronize them using mutexes. Use pthread_create() for thread creation and pthread_mutex_lock() for synchronization. 4 | 5 | (e.g.: I/P: Number of threads; O/P: Thread execution order) 6 | -------------------------------------------------------------------------------- /Linux_Internals/User_Space_File_Reader/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/User_Space_File_Reader/User_Space_File_Reader.txt: -------------------------------------------------------------------------------- 1 | User-Space File Reader 2 | 3 | WTD: Read a file from a user-space program using system calls. Use open() and read() system calls to read a file and display its contents. 4 | 5 | (e.g.: I/P: File name; O/P: File contents) 6 | -------------------------------------------------------------------------------- /Linux_Internals/User_Space_to_Kernel_Space_Communication/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/User_Space_to_Kernel_Space_Communication/User_Space_to_Kernel_Space_Communication.txt: -------------------------------------------------------------------------------- 1 | User-Space to Kernel-Space Communication 2 | 3 | WTD: Implement a simple user-space to kernel-space communication using procfs. Create a proc file and use it to send and receive messages from a kernel module. 4 | 5 | (e.g.: I/P: String message; O/P: Echoed message from kernel-space) 6 | -------------------------------------------------------------------------------- /Linux_Internals/Zero_Copy_Data_Transfer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Linux_Internals/Zero_Copy_Data_Transfer/Zero_Copy_Data_Transfer.txt: -------------------------------------------------------------------------------- 1 | Zero-Copy Data Transfer 2 | 3 | WTD: Implement a zero-copy data transfer mechanism between two processes using shared memory. Use shared memory mechanisms like mmap() for zero-copy transfer. 4 | 5 | (e.g.: I/P: Data to transfer; O/P: Data received) 6 | -------------------------------------------------------------------------------- /Memory_Management/Custom_strdup_Function/Custom_strdup_Function.txt: -------------------------------------------------------------------------------- 1 | Custom strdup Function: 2 | 3 | Implement a custom strdup function that copies a string into dynamically allocated memory. 4 | 5 | (e.g.: I/P: "hello"; O/P: Address of new string "hello") 6 | 7 | 8 | How to Do: 9 | - Use strlen to find the length of the input string. 10 | - Use malloc to dynamically allocate memory of length strlen(input) + 1. 11 | - Use strcpy or a loop to copy the contents of the input string into this new memory block. 12 | - Return the address of the new string. 13 | 14 | Detailed Example: 15 | You'll need to allocate strlen(input) + 1 bytes to also store the null-terminator. 16 | 17 | Hint: Remember to allocate an extra byte for the null-terminator. 18 | -------------------------------------------------------------------------------- /Memory_Management/Custom_strdup_Function/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Custom_strdup_Function/Solution/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Custom strdup Function: 3 | 4 | Implement a custom strdup function that copies a string into dynamically allocated memory. 5 | 6 | (e.g.: I/P: "hello"; O/P: Address of new string "hello") 7 | 8 | author : Vaaarad07 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | #define MAX_STR_SIZE 20 15 | 16 | char* new_addr(char arr[],int size){ 17 | char* ptr = (char*)malloc(sizeof(size)); 18 | strcpy(ptr,arr); 19 | return ptr; 20 | } 21 | 22 | int main(){ 23 | char arr[MAX_STR_SIZE]; 24 | printf("Enter string: "); 25 | scanf("%s",arr); 26 | char * new_ptr = new_addr(arr,strlen(arr)+1); 27 | printf("returned str is %s\n\n",new_ptr); 28 | //printf("You entered %s & length is %d\n\n",arr,strlen(arr)); 29 | } -------------------------------------------------------------------------------- /Memory_Management/Dynamic_Array/Dynamic_Array.txt: -------------------------------------------------------------------------------- 1 | Dynamic Array: 2 | 3 | Implement a dynamic array with the ability to resize itself. 4 | 5 | How to do? 6 | - Start with an initial size. 7 | - When adding an element, check if the array is full. If so, resize it. 8 | - When removing an element, consider resizing down if the array is less than half full. 9 | 10 | Hint: Use malloc and free (or your custom allocator) to manage the dynamic memory. 11 | -------------------------------------------------------------------------------- /Memory_Management/Dynamic_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Fragmentation_Detector/Fragmentation_Detector.txt: -------------------------------------------------------------------------------- 1 | Fragmentation Detector: 2 | 3 | Write a program that simulates memory allocation and deallocation, and can report the amount of fragmented memory. 4 | 5 | (e.g.: I/P: Allocate 10, Free 5, Allocate 3; O/P: Fragmentation = 2 bytes) 6 | 7 | How to do? 8 | - Start with a fixed-size memory pool. 9 | - Keep track of allocated and free blocks. 10 | - Fragmentation can be calculated as the total size of free blocks - the largest free block. 11 | 12 | Hint: A sorted list or tree can be useful for keeping track of free blocks to quickly find the maximum free block size. 13 | Detailed Example: 14 | 15 | If you allocate 10 bytes and then free 5 bytes, followed by allocating 3 bytes, you'd have 2 bytes that couldn't be used for a request of size 3 or more, hence 2 bytes are fragmented. 16 | -------------------------------------------------------------------------------- /Memory_Management/Fragmentation_Detector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Garbage_Collector_Simulator/Garbage_Collector_Simulator.txt: -------------------------------------------------------------------------------- 1 | Garbage Collector Simulator: 2 | 3 | Implement a simple mark-and-sweep garbage collector. 4 | 5 | (e.g.: I/P: Allocate 5, Allocate 7, Mark 5, Sweep; O/P: 7 collected) 6 | 7 | How to Do? 8 | - Create a list or array to keep track of all currently allocated memory blocks. 9 | - Add a boolean field to each block to represent whether it is "marked" for garbage collection. 10 | - Implement a mark function that takes an address and marks the corresponding block. 11 | - Implement a sweep function that frees all unmarked blocks and unmarks the remaining blocks. 12 | 13 | Detailed Example: 14 | If you allocate blocks of 5 and 7 bytes and then mark the 5-byte block, running the sweep should collect the 7-byte block. 15 | 16 | Hint: Use a linked list or array to keep track of allocated blocks, along with a "marked" flag. 17 | -------------------------------------------------------------------------------- /Memory_Management/Garbage_Collector_Simulator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Heap_Metadata_Inspector/Heap_Metadata_Inspector.txt: -------------------------------------------------------------------------------- 1 | Heap Metadata Inspector: 2 | 3 | Implement a function to inspect and print the metadata of the heap, like block sizes and free/used status. 4 | 5 | (e.g.: I/P: Allocate 5, Free 2; O/P: Block 1: Used, Block 2: Free) 6 | 7 | How to Do? 8 | - Create a simulated heap with an array and metadata structures for each block. 9 | - Upon allocation or freeing, update the block's metadata. 10 | - Create a function to loop through the metadata structures and print out their status. 11 | 12 | Detailed Example: 13 | Your metadata might contain fields like isFree and blockSize. When you allocate 5 and then free 2, your function could print out: Block 1: Used, size 5; Block 2: Free, size 2. 14 | 15 | Hint: Check out how dynamic memory allocators keep track of block sizes and free/used status for ideas on storing metadata. 16 | -------------------------------------------------------------------------------- /Memory_Management/Heap_Metadata_Inspector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory-Bound_Priority_Queue/Memory-Bound_Priority_Queue.txt: -------------------------------------------------------------------------------- 1 | Memory-Bound_Priority_Queue 2 | 3 | Create a priority queue that only uses a pre-defined array. No extra memory allocations allowed. High-priority items come out first when removed. 4 | 5 | (e.g.: I/P: Insert 5, 9, 2; Remove; O/P: Removed 9) 6 | 7 | How to Do: 8 | - Declare an array of a fixed size, say N, to represent your priority queue. 9 | - Use an integer variable to keep track of the current size of the queue. 10 | - Implement an insert function that adds elements to the array in such a way that the highest priority element is always at the top (or bottom). 11 | - Implement a remove function that removes and returns the highest priority element. 12 | 13 | 14 | Detailed Example: 15 | You could use a binary heap data structure. Insert elements using heapify-up and remove elements using heapify-down algorithms. 16 | 17 | Hint: If using a binary heap, understand how to maintain the heap properties during insertion and removal. 18 | -------------------------------------------------------------------------------- /Memory_Management/Memory-Bound_Priority_Queue/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory-Mapped_Circular_Buffer/Memory-Mapped_Circular_Buffer.txt: -------------------------------------------------------------------------------- 1 | Memory-Mapped_Circular_Buffer 2 | 3 | Simulate a memory-mapped I/O device by implementing a circular buffer. Implement read and write functions to the buffer, taking care not to overflow. 4 | 5 | (e.g.: I/P: Write 5, 7, 9; Read 2 times; Write 12; O/P: Read 5, 7; Next write at address wrapping to start) 6 | 7 | How to do? 8 | - Implement a circular buffer with a fixed size. 9 | - Implement read and write functions. 10 | - Keep track of head and tail pointers. 11 | - Make sure to handle the buffer wrap-around condition. 12 | 13 | Hint: When the head reaches the end of the buffer, it should wrap around to the beginning. The same applies to the tail. 14 | 15 | Detailed Example: 16 | If you write 5, 7, 9 to the buffer and then read twice, you should read 5 and 7. The next write should wrap around if the buffer is full. 17 | -------------------------------------------------------------------------------- /Memory_Management/Memory-Mapped_Circular_Buffer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Access_Logger/Memory_Access_Logger.txt: -------------------------------------------------------------------------------- 1 | Memory Access Logger: 2 | 3 | Implement a logger that logs each memory access (read or write) to a simulated block of memory. 4 | 5 | (e.g.: I/P: Write to address 5, Read from address 5; O/P: Log) 6 | 7 | How to Do? 8 | - Create an array to simulate a block of memory. 9 | - Implement a logger function that takes an address and an operation type as inputs. 10 | - Use a data structure like a list or a dictionary to record each read and write operation. 11 | - For each operation, store the address and the type of operation (read or write) in the logger. 12 | 13 | Detailed Example: 14 | If you write to address 5 and then read from address 5, the log should contain these two operations. 15 | 16 | Hint: You can use an array or list to act as the memory block and another data structure to log the operations. 17 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Access_Logger/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Alignment_Checker/Memory_Alignment_Checker.txt: -------------------------------------------------------------------------------- 1 | Memory Alignment Checker: 2 | 3 | Write a function that checks if a pointer is aligned to a specified number of bytes. 4 | 5 | (e.g.: I/P: Address 0x1004, Alignment 4; O/P: Aligned) 6 | 7 | How to Do: 8 | - Take the memory address and the alignment size as inputs. 9 | - Use bitwise AND between (address & (alignment - 1)). If the result is 0, the memory is aligned. 10 | 11 | Detailed Example: 12 | If the address is 0x1004 and the alignment is 4, then (0x1004 & (4 - 1)) == 0, which means it is aligned. 13 | 14 | Hint: The bitwise AND operation is your main tool here. 15 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Alignment_Checker/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Defragmenter/Memory_Defragmenter.txt: -------------------------------------------------------------------------------- 1 | Memory Defragmenter: 2 | 3 | Implement memory allocation and freeing in a simulated memory pool. 4 | 5 | ( e.g.: I/P: Allocate 10, Free 5, Defragment; O/P: Memory defragmented) 6 | 7 | How to Do? 8 | - Implement a function called defragment in your memory management system. 9 | - This function should go through the list of free blocks and consolidate adjacent free blocks into larger blocks. 10 | - Update your records of free and allocated blocks to reflect this consolidation. 11 | 12 | Detailed Example: 13 | If you allocate 10 bytes, free 5 bytes, and then run the defragmenter, it should rearrange memory so that all the free space is contiguous. 14 | 15 | Hint: You'll need to update your records of allocated and free blocks during defragmentation. 16 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Defragmenter/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Footprint_Analyzer/Memory_Footprint_Analyzer.txt: -------------------------------------------------------------------------------- 1 | Memory Footprint Analyzer: 2 | 3 | Write a program that can analyze the memory footprint of various data structures. Also, don't limit it to known data types. When given a user defined structure or union find its memory size. 4 | 5 | (e.g.: I/P: int, float, double; O/P: 4, 4, 8) 6 | 7 | How to Do? 8 | - Use the sizeof operator to find the size of various data types like int, float, and double. 9 | - Output these sizes. 10 | 11 | Detailed Example: 12 | Simply using sizeof(int) would return 4, sizeof(float) would return 4, and sizeof(double) would return 8 on most systems. 13 | 14 | Hint: The sizeof operator will give you the size in bytes, making this fairly straightforward. 15 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Footprint_Analyzer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Initialization_Library/Memory_Initialization_Library.txt: -------------------------------------------------------------------------------- 1 | Memory Initialization Library: 2 | 3 | Create a library function to initialize a block of memory with a specific value. 4 | 5 | (e.g.: I/P: Block size 5, Value 0xAA; O/P: 0xAAAAAAAAAA) 6 | 7 | How to Do? 8 | - Accept the block size and the value to initialize with as parameters. 9 | - Use a loop to go through each byte in the block and set it to the specified value. 10 | 11 | Detailed Example: 12 | If you have to fill a block of 5 bytes with the value 0xAA, your output memory block would look like 0xAAAAAAAAAA. 13 | 14 | Hint: You can use loops or the memset function to accomplish this task. 15 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Initialization_Library/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Leak_Detector/Memory_Leak_Detector.txt: -------------------------------------------------------------------------------- 1 | Memory Leak Detector: 2 | 3 | Implement a simple memory leak detector for dynamic memory allocation functions like malloc and free. 4 | 5 | (e.g.: I/P: Allocate 5, Allocate 7, Free 5; O/P: Leak Detected at 7) 6 | 7 | How to do? 8 | - Keep a list of all currently allocated blocks. 9 | - When malloc is called, add the block to the list. 10 | - When free is called, remove the block from the list. 11 | - At the end of the program, check if the list is empty. If not, report a leak. 12 | 13 | Hint: Use a linked list to keep track of allocated blocks. 14 | 15 | Detailed Example: 16 | If you allocate 5 and 7 bytes but only free the 5-byte block, the program should report a memory leak at 7 bytes. 17 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Leak_Detector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Offset_Calculator/Memory_Offset_Calculator.txt: -------------------------------------------------------------------------------- 1 | Memory Offset Calculator: 2 | 3 | Create a function that calculates the offset of a given field in a structure. 4 | 5 | (e.g.: I/P: Field 'x' in struct A; O/P: Offset in bytes) 6 | 7 | How to Do? 8 | - Define the structure with its fields. 9 | - Implement a function that takes the name of a field as an argument. 10 | - Use the offsetof macro or manual pointer arithmetic to find the offset of the given field. 11 | - Return the offset in bytes. 12 | 13 | Detailed Example: 14 | For a struct with fields 'a', 'b', and 'x', finding the offset of 'x' would return its position in bytes from the beginning of the struct. 15 | 16 | Hint: The offsetof macro in C can help find the offset easily. 17 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Offset_Calculator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Overlay_Management/Memory_Overlay_Management.txt: -------------------------------------------------------------------------------- 1 | Memory Overlay Management: 2 | 3 | Simulate a memory overlay mechanism where different data can occupy the same memory region at different times. 4 | 5 | (e.g.: I/P: Load Overlay 1, Load Overlay 2; O/P: Memory region updated) 6 | 7 | How to Do: 8 | - Declare a fixed-size array to represent your memory block. 9 | - Create a function to "load" an overlay into this memory block. 10 | - Create a function to "unload" or clear the current overlay. 11 | - Use a variable to keep track of which overlay is currently loaded. 12 | 13 | Detailed Example: 14 | Your "load" function could simply copy the contents of an overlay into the array, effectively overwriting whatever was there before. 15 | 16 | Hint: Keep state information to know which overlay is currently loaded, and manage transitions properly. 17 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Overlay_Management/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Pool/Memory_Pool.txt: -------------------------------------------------------------------------------- 1 | Memory Pool: 2 | 3 | Create multiple memory pools, each with its own fixed-size buffer. 4 | ( e.g.: I/P: Allocate 5 from Pool A, Allocate 7 from Pool B; O/P: Addresses allocated from pools) 5 | 6 | How to Do? 7 | - Create multiple arrays to serve as different memory pools. 8 | - Each pool should have its own list of free blocks. 9 | - Implement allocate and free functions that take an additional parameter to specify the pool. 10 | - Use the specified pool's free list to allocate and free blocks. 11 | 12 | Detailed Example: 13 | If you allocate 5 bytes from Pool A and 7 bytes from Pool B, each pool should return an address from its own buffer. 14 | 15 | Hint: You can manage each pool's free list with a linked list or array. 16 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Pool/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Safety_Checker/Memory_Safety_Checker.txt: -------------------------------------------------------------------------------- 1 | Memory Safety Checker: 2 | 3 | Write a function to check for buffer overflows and underflows. 4 | 5 | (e.g.: I/P: Buffer of 10 bytes, Write 12 bytes; O/P: Buffer overflow detected) 6 | 7 | How to Do? 8 | - Implement a function to calculate and report statistics. 9 | - For each allocation or deallocation, update your records of used memory and free blocks. 10 | - The function should return the total memory used, the number of free blocks, and the size of the largest free block. 11 | 12 | Detailed Example: 13 | If you try to write 12 bytes into a 10-byte buffer, the function should detect this and output "Buffer overflow detected." 14 | 15 | Hint: Always check the size before performing memory operations. 16 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Safety_Checker/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Memory_Statistics_Reporter/Memory_Statistics_Reporter.txt: -------------------------------------------------------------------------------- 1 | Memory Statistics Reporter: 2 | 3 | Create a memory management system that keeps track of allocated and free blocks. 4 | 5 | (e.g.: I/P: Allocate 100 bytes, Free 50 bytes; O/P: Total used: 50 bytes, Free blocks: 1, Largest free block: 50 bytes) 6 | 7 | How to Do? 8 | - Implement a function to calculate and report statistics. 9 | - For each allocation or deallocation, update your records of used memory and free blocks. 10 | - The function should return the total memory used, the number of free blocks, and the size of the largest free block. 11 | 12 | Detailed Example: 13 | If you allocate 100 bytes and then free 50 bytes, the statistics should show 50 bytes in use, 1 free block, and the largest free block being 50 bytes. 14 | 15 | Hint: Use a data structure to keep track of allocations and deallocations. 16 | -------------------------------------------------------------------------------- /Memory_Management/Memory_Statistics_Reporter/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Object_Serialization/Object_Serialization.txt: -------------------------------------------------------------------------------- 1 | Object Serialization: 2 | 3 | Implement object serialization and deserialization into/from a byte array. 4 | 5 | (e.g.: I/P: Object {a: 1, b: 2}; O/P: Byte array) 6 | 7 | How to Do? 8 | - Loop through each field in the object and convert it to a byte array. 9 | - Concatenate these byte arrays together for serialization. 10 | - For deserialization, read the byte array in chunks corresponding to each field and convert it back to the object. 11 | 12 | Detailed Example: 13 | If your object has integer fields a and b, your byte array after serialization might look like [00 00 00 01 00 00 00 02] for {a: 1, b: 2}. 14 | 15 | Hint: Consider using a standard format like JSON or Protocol Buffers as a blueprint for your own simple serialization format. 16 | -------------------------------------------------------------------------------- /Memory_Management/Object_Serialization/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Segmented_Memory_Allocator/Segmented_Memory_Allocator.txt: -------------------------------------------------------------------------------- 1 | Segmented Memory Allocator: 2 | 3 | Create multiple fixed-size buffers (arrays) to act as segments. 4 | 5 | (e.g.: I/P: Allocate 10 bytes in Segment A, Allocate 20 bytes in Segment B; O/P: Addresses allocated in segments) 6 | 7 | How to Do? 8 | - Create an array of structures, where each structure represents a memory segment with its own memory buffer and stack top. 9 | - Implement allocate and free functions that take an additional parameter to specify the segment. 10 | - Inside these functions, use the corresponding segment's stack top to allocate or free memory. 11 | - Update the stack top for the specified segment when memory is allocated or freed. 12 | 13 | Detailed Example: 14 | If you allocate 10 bytes in Segment A and 20 bytes in Segment B, each segment's stack top should move accordingly. 15 | 16 | Hint: You can use an array of structures, where each structure represents a segment with its own stack top and memory buffer. 17 | -------------------------------------------------------------------------------- /Memory_Management/Segmented_Memory_Allocator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Slab_Allocator/Slab_Allocator.txt: -------------------------------------------------------------------------------- 1 | Slab Allocator: 2 | 3 | Implement a simple slab allocator. 4 | 5 | (e.g.: I/P: Allocate object of 32 bytes; O/P: Address from slab allocator) 6 | 7 | How to Do? 8 | - Initialize your memory pool with fixed-size blocks, known as slabs. 9 | - Implement a function to allocate memory, which checks for an available slab of the requested size. 10 | - If a slab is available, mark it as used and return its address. 11 | - Implement a function to deallocate memory, which marks a slab as free. 12 | - Optionally, implement a function to merge free slabs and create larger blocks of memory. 13 | 14 | Detailed Example: 15 | When you request an object of 32 bytes, the allocator should return an address from its pool of 32-byte slabs. 16 | 17 | Hint: You may use linked lists or arrays to manage slabs of memory. 18 | -------------------------------------------------------------------------------- /Memory_Management/Slab_Allocator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Stack-based_Memory_Allocator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Stack-based_Memory_Allocator/Stack-based_Memory_Allocator.txt: -------------------------------------------------------------------------------- 1 | Stack-based Memory Allocator: 2 | 3 | Design a memory allocator that allocates memory in a Last-In-First-Out (LIFO) manner from a fixed-size buffer. The allocator should have allocate and free functions. 4 | 5 | (e.g.: I/P: Request for 10, 20, and 15 bytes, then Free 15 bytes; O/P: Addresses allocated and next available address after freeing) 6 | 7 | How to do? 8 | - Create a fixed-size buffer (array) to act as the memory pool. 9 | - Keep track of the top of the stack. 10 | - When allocating memory, move the stack top accordingly and return the address. 11 | - When freeing memory, validate that it is indeed the most recently allocated block and then move the stack top back. 12 | 13 | Detailed Example: For an allocation request of sizes 10, 20, and 15 bytes, the stack top should move each time memory is allocated. When you free 15 bytes, the stack top should move back to the end of the 20-byte block 14 | 15 | Hint: Use a structure to represent each allocation, storing the size and the starting address. 16 | -------------------------------------------------------------------------------- /Memory_Management/Stack_Overflow_Detector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Stack_Overflow_Detector/Stack_Overflow_Detector.txt: -------------------------------------------------------------------------------- 1 | Stack Overflow Detector: 2 | 3 | Implement a stack overflow detector for a simulated stack data structure. 4 | 5 | (e.g.: I/P: Push 10 items in a stack of size 9; O/P: Stack Overflow) 6 | 7 | How to Do? 8 | - Create a stack with a maximum size attribute. 9 | - Implement push and pop methods. 10 | - During each push, check if adding an element would exceed the stack's maximum size. If it would, output "Stack Overflow". 11 | 12 | Detailed Example: 13 | If your stack has a maximum size of 9, attempting to push a 10th item should trigger your overflow detection and output "Stack Overflow". 14 | 15 | Hint: Use an integer variable to keep track of the current number of elements in the stack. 16 | -------------------------------------------------------------------------------- /Memory_Management/Virtual_Memory_Simulator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Virtual_Memory_Simulator/Virtual_Memory_Simulator.txt: -------------------------------------------------------------------------------- 1 | Virtual Memory Simulator: 2 | 3 | Simulate virtual memory using an array to represent physical memory and another array to represent the page table. 4 | 5 | ( e.g.: I/P: Access page 3, Access page 7; O/P: Page 3 loaded, Page 7 loaded) 6 | 7 | How to Do? 8 | - Use one array to simulate the physical memory and another array to act as the page table. 9 | - Implement an accessPage function that checks if the requested page is in physical memory. If not, it "loads" it. 10 | - Update the page table whenever a page is loaded into physical memory. 11 | 12 | Detailed Example: 13 | If you access pages 3 and 7, the simulator should indicate that these pages have been loaded into physical memory. 14 | 15 | Hint: The page table will help you map virtual addresses to physical addresses. 16 | -------------------------------------------------------------------------------- /Memory_Management/Write-Once_Memory_Simulator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Memory_Management/Write-Once_Memory_Simulator/Write-Once_Memory_Simulator.txt: -------------------------------------------------------------------------------- 1 | Write-Once Memory Simulator: 2 | 3 | Implement a write-once memory block where each byte can be written only once. 4 | 5 | (e.g.: I/P: Write 0xAA to address 5 twice; O/P: Write Failed) 6 | 7 | How to Do? 8 | - Create an array to act as your memory block. 9 | - Create a boolean array of the same size to track if a location has been written to. 10 | - When attempting to write, check the boolean array. If the byte has been written to already, output "Write Failed". 11 | 12 | Detailed Example: 13 | If you attempt to write 0xAA to address 5 two times, the second attempt should consult the boolean array, find it's already been written to, and output "Write Failed". 14 | 15 | Hint: A secondary array can act as flags to keep track of each byte's write status. 16 | -------------------------------------------------------------------------------- /Pointers/Calculate_Dot_Product_Of_Vectors/Calculate_Dot_Product_Of_Vectors.txt: -------------------------------------------------------------------------------- 1 | Write a function to calculate the dot product of two vectors using pointers. 2 | 3 | WTD: Traverse both vectors, multiplying corresponding elements and summing the results. 4 | 5 | (e.g.: I/P: int vec1[] = {1,2,3}, vec2[] = {4,5,6} ,O/P: 32 ) -------------------------------------------------------------------------------- /Pointers/Calculate_Dot_Product_Of_Vectors/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Check_Pointers_Point_To_Same_Array/Check_Pointers_Point_To_Same_Array.txt: -------------------------------------------------------------------------------- 1 | Design a function that determines if two pointers point to the same array. 2 | 3 | WTD: Traverse from both pointers in both forward and backward directions until null or boundary is hit. If both pointers hit the same boundaries, they belong to the same array. 4 | 5 | (e.g.: I/P: int arr[] = {1,2,3,4}, *ptr1 = &arr[1], *ptr2 = &arr[3]; O/P: True ) -------------------------------------------------------------------------------- /Pointers/Check_Pointers_Point_To_Same_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Check_String_Palindrome/Check_String_Palindrome.txt: -------------------------------------------------------------------------------- 1 | Create a program that checks if a string is a palindrome using pointers. 2 | 3 | WTD: Use two pointers, one at the start and the other at the end. Traverse inward, comparing characters. 4 | 5 | (e.g.: I/P: "radar" ,O/P: True) -------------------------------------------------------------------------------- /Pointers/Check_String_Palindrome/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Check_String_Palindrome/Solution/main.c: -------------------------------------------------------------------------------- 1 | /*Create a program that checks if a string is a palindrome using pointers. 2 | 3 | WTD: Use two pointers, one at the start and the other at the end. Traverse inward, comparing characters. 4 | 5 | (e.g.: I/P: "radar" ,O/P: True)*/ 6 | 7 | #include 8 | #include 9 | 10 | int checkPalindrome(char *str) { 11 | char *first = str; 12 | char *last = str + (strlen(str) - 1); 13 | 14 | while(first 8 | 9 | void concatenate_strs(char *str1, char *str2){ 10 | while(*str1 != '\0'){ 11 | str1++; 12 | } 13 | 14 | while(*str2 != '\0'){ 15 | *str1 = *str2; 16 | str1++; 17 | str2++; 18 | } 19 | *str1 = '\0'; 20 | } 21 | 22 | int main() { 23 | 24 | char str1[] = "Good "; 25 | char str2[] = "Morning"; 26 | 27 | concatenate_strs(str1, str2); 28 | 29 | printf("%s",str1); 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /Pointers/Convert_String_To_Lowercase/Convert_String_To_Lowercase.txt: -------------------------------------------------------------------------------- 1 | Write a function that converts a string to lowercase using pointers. 2 | 3 | WTD: Traverse the string. For each character, if it's uppercase, add 32 to convert it to lowercase. 4 | 5 | (e.g.: I/P: "HELLO" ,O/P: "hello" ) -------------------------------------------------------------------------------- /Pointers/Convert_String_To_Lowercase/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Count_Array_Elements_Without_Loop/Count_Array_Elements_Without_Loop.txt: -------------------------------------------------------------------------------- 1 | Create a function that uses pointer arithmetic to count the number of elements in an array without utilizing loop constructs. 2 | 3 | WTD: Subtract the pointer to the first element from the pointer just past the last element. 4 | 5 | (e.g.: I/P: int arr[] = {1,2,3,4,5} ,O/P: 5 ) 6 | -------------------------------------------------------------------------------- /Pointers/Count_Array_Elements_Without_Loop/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Count_Array_Elements_Without_Loop/Solution/main.c: -------------------------------------------------------------------------------- 1 | /*Create a function that uses pointer arithmetic to count the number of elements in an array without utilizing loop constructs. 2 | 3 | WTD: Subtract the pointer to the first element from the pointer just past the last element. 4 | 5 | (e.g.: I/P: int arr[] = {1,2,3,4,5} ,O/P: 5 ) */ 6 | 7 | #include 8 | 9 | int count_elements(int *start, int *end){ 10 | 11 | return end-start; 12 | } 13 | int main(){ 14 | 15 | int arr[] = {1,2,3,4,5}; 16 | 17 | printf("%d",count_elements(arr, arr + sizeof(arr) / sizeof(arr[0]))); 18 | printf("%ls",arr); 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /Pointers/Custom_Memcpy_Function/Custom_Memcpy_Function.txt: -------------------------------------------------------------------------------- 1 | Design a function similar to memcpy() that copies memory areas using pointers. 2 | 3 | WTD: Use pointers to traverse both the source and destination and copy each byte. 4 | 5 | (e.g.: I/P: Source = "hello", Destination (empty buffer), Length = 5 ; O/P: Destination = "hello") -------------------------------------------------------------------------------- /Pointers/Custom_Memcpy_Function/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Custom_Strtok_Function/Custom_Strtok_Function.txt: -------------------------------------------------------------------------------- 1 | Implement a custom strtok() function using pointers that splits a string based on a delimiter. 2 | 3 | WTD: Use pointers to traverse the string. When the delimiter is found, replace it with '\0' and return the start of the token. 4 | 5 | (e.g.: I/P: String = "embedded,systems,linux", Delimiter = "," ; O/P: "embedded", "systems", "linux") -------------------------------------------------------------------------------- /Pointers/Custom_Strtok_Function/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Detect_Pointer_Out_Of_Bounds/Detect_Pointer_Out_Of_Bounds.txt: -------------------------------------------------------------------------------- 1 | Implement a function that detects if a pointer has gone out of bounds of an array. 2 | 3 | WTD: Compare the pointer with the address of the first and past-the-last elements of the array. 4 | 5 | (e.g.: I/P: Array = {1,2,3,4,5}, Pointer pointing after last element ; O/P: Out of bounds) -------------------------------------------------------------------------------- /Pointers/Detect_Pointer_Out_Of_Bounds/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Find_Array_Intersection/Find_Array_Intersection.txt: -------------------------------------------------------------------------------- 1 | Design a function that uses pointers to find the intersection of two arrays. 2 | 3 | WTD: If the arrays are sorted, use two pointers to traverse and find common elements. If not, use a hash table for one array and search for elements of the other. 4 | 5 | (e.g.: I/P: int arr1[] = {1,2,3,4}, arr2[] = {3,4,5,6} ,O/P: {3,4} ) 6 | -------------------------------------------------------------------------------- /Pointers/Find_Array_Intersection/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Find_Common_Elements_In_Sorted_Arrays/Find_Common_Elements_In_Sorted_Arrays.txt: -------------------------------------------------------------------------------- 1 | Implement a function that finds the common elements in three sorted arrays using pointers. 2 | 3 | WTD: Use three pointers. Move the pointer pointing to the smallest value until all three pointers point to the same value or the end is reached. 4 | 5 | (e.g.: I/P: int arr1[] = {1,5,10,20,40,80}, arr2[] = {6,7,20,80,100}, arr3[] = {3,4,15,20,30,70,80,120} ,O/P:{20,80} ) -------------------------------------------------------------------------------- /Pointers/Find_Common_Elements_In_Sorted_Arrays/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Find_Data_Type_Size_Without_Sizeof/Find_Data_Type_Size_Without_Sizeof.txt: -------------------------------------------------------------------------------- 1 | Write a program to find the size of a data type without using the `sizeof` operator, use pointer arithmetic. 2 | 3 | WTD: Declare a pointer to the given type and increment it. Subtract the original pointer value from the incremented value to get the size. 4 | 5 | (e.g.: I/P: int, O/P: 4( based on platform)) -------------------------------------------------------------------------------- /Pointers/Find_Data_Type_Size_Without_Sizeof/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Find_First_Non_Repeated_Character/Find_First_Non_Repeated_Character.txt: -------------------------------------------------------------------------------- 1 | Implement a program that finds the first non-repeated character in a string using pointers. 2 | 3 | WTD: Use a fixed-size array to count occurrences. Traverse the string twice: first to count and then to find the non-repeated character. 4 | 5 | (e.g.: I/P: "swiss" ,O/P: 'w' ) -------------------------------------------------------------------------------- /Pointers/Find_First_Non_Repeated_Character/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Find_Linked_List_Length/Find_Linked_List_Length.txt: -------------------------------------------------------------------------------- 1 | Design a program that finds the length of a linked list using double pointers. 2 | 3 | WTD: Use a double pointer (or two pointers) technique. Move one pointer twice as fast as the other. When the faster one reaches the end, the slower one will be halfway. 4 | 5 | (e.g.: I/P:1->2->3->4->5 ,O/P:5 ) -------------------------------------------------------------------------------- /Pointers/Find_Linked_List_Length/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Find_Overlapping_Elements_In_Arrays/Find_Overlapping_Elements_In_Arrays.txt: -------------------------------------------------------------------------------- 1 | Design a program to find the overlapping part of two arrays using pointers. 2 | 3 | WTD: Use two pointers to traverse both arrays. When a common element is found, move both pointers forward. 4 | 5 | (e.g.: I/P: int arr1[] = {1,2,3,4,5,6}, arr2[] = {5,6,7,8} ,O/P: {5,6} ) -------------------------------------------------------------------------------- /Pointers/Find_Overlapping_Elements_In_Arrays/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Flatten_2D_Array_To_1D/Flatten_2D_Array_To_1D.txt: -------------------------------------------------------------------------------- 1 | Create a program that flattens a 2D array into a 1D array using pointers. 2 | 3 | WTD: Use nested loops (or equivalent pointer arithmetic) to traverse the 2D array and copy each element to the 1D array. 4 | 5 | (I/P: int arr[][] = {{1,2},{3,4}} ,O/P:{1,2,3,4} ) -------------------------------------------------------------------------------- /Pointers/Flatten_2D_Array_To_1D/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Memory_Leak_Detector/Memory_Leak_Detector.txt: -------------------------------------------------------------------------------- 1 | Implement a custom memory allocator and deallocator. Track allocations and deallocations to detect memory leaks using pointers. 2 | 3 | WTD: Implement custom allocation and deallocation functions. Maintain a list of allocated blocks. On deallocation, remove from the list. At the end, non-deallocated blocks are leaks. 4 | 5 | (e.g.: I/P: Allocate 5 blocks, deallocate 4 blocks ; O/P: 1 block not deallocated) -------------------------------------------------------------------------------- /Pointers/Memory_Leak_Detector/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Merge_Two_Sorted_Arrays/Merge_Two_Sorted_Arrays.txt: -------------------------------------------------------------------------------- 1 | Implement a function that merges two sorted arrays into a third array using pointers. 2 | 3 | WTD: Use three pointers to traverse and compare the two input arrays and insert the smaller element into the third array. 4 | 5 | (e.g.: I/P: int arr1[] = {1,3,5}, arr2[] = {2,4,6} ,O/P: {1,2,3,4,5,6} ) -------------------------------------------------------------------------------- /Pointers/Merge_Two_Sorted_Arrays/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Move_2D_Point/Move_2D_Point.txt: -------------------------------------------------------------------------------- 1 | Create a structure representing a point in 2D space. Implement a function that moves the point using pointer arithmetic. 2 | 3 | WTD: Access the x and y coordinates of the point using pointers and modify them based on the move values. 4 | 5 | (e.g.: I/P: Point (2,3), Move by (1,-1) ; O/P: New Point (3,2)) -------------------------------------------------------------------------------- /Pointers/Move_2D_Point/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Rotate_Array_By_K_Elements/Rotate_Array_By_K_Elements.txt: -------------------------------------------------------------------------------- 1 | Create a function that rotates an array to the right by `k` elements using pointers. 2 | 3 | WTD: Reverse the whole array, then reverse the first k elements, and finally reverse the rest. 4 | 5 | (e.g.: I/P: int arr[] = {1,2,3,4,5}, k=2 ,O/P: {4,5,1,2,3} ) -------------------------------------------------------------------------------- /Pointers/Rotate_Array_By_K_Elements/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Segregate_Even_And_Odd_Using_Pointers/Segregate_Even_And_Odd_Using_Pointers.txt: -------------------------------------------------------------------------------- 1 | Create a function that segregates even and odd values of an integer array using pointers. 2 | 3 | WTD: Use two pointers, one starting from the beginning and the other from the end. Traverse and swap even and odd numbers until the two pointers meet. 4 | 5 | (e.g.: I/P: int arr[] = {12,34,9,8,45,90} ,O/P: {12,34,8,90,9,45} ) -------------------------------------------------------------------------------- /Pointers/Segregate_Even_And_Odd_Using_Pointers/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Split_String_Into_Halves/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Split_String_Into_Halves/Split_String_Into_Halves.txt: -------------------------------------------------------------------------------- 1 | Implement a function that splits a string into two halves and returns pointers to the beginning of each half. 2 | 3 | WTD: Use pointer arithmetic to find the middle of the string. Return the original and the middle pointers. 4 | 5 | (e.g.: I/P: "HelloWorld" ,O/P: "Hello", "World" ) -------------------------------------------------------------------------------- /Pointers/Swap_Two_Strings_Using_Pointers/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Swap_Two_Strings_Using_Pointers/Swap_Two_Strings_Using_Pointers.txt: -------------------------------------------------------------------------------- 1 | Implement a program that swaps two strings using pointers to pointers. 2 | 3 | WTD: Use a pointer to pointer to swap the base addresses of the two strings. 4 | 5 | (e.g.: I/P: char *str1 = "hello", *str2 = "world" ,O/P: str1 = "world", str2 = "hello" ) -------------------------------------------------------------------------------- /Pointers/Trim_String_Whitespace/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Pointers/Trim_String_Whitespace/Trim_String_Whitespace.txt: -------------------------------------------------------------------------------- 1 | Write a function that trims leading and trailing whitespace from a string using pointers. 2 | 3 | WTD: Use two pointers to find the first and last non-whitespace characters. Move characters to trim the string 4 | 5 | (e.g.: I/P: " Hello World " ,O/P: "Hello World" ) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # C-Programming-Questions 2 | You can find a list of programming problems on various topic in C 3 | -------------------------------------------------------------------------------- /Searching/Binary_search_recursive/Binary_search_recursive.txt: -------------------------------------------------------------------------------- 1 | Implement binary search recursively. 2 | 3 | WTD: Create a function that uses recursion to implement binary search on a sorted array. Your function should make a recursive call after halving the array based on the comparison with the target element. 4 | 5 | Algorithm: Recursive binary search reduces the problem size by half in each recursive call. 6 | 7 | (e.g.: I/P: [1, 2, 3, 4, 5], 3 ; O/P: 2) 8 | -------------------------------------------------------------------------------- /Searching/Binary_search_recursive/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Count_array_rotations/Count_array_rotations.txt: -------------------------------------------------------------------------------- 1 | Count the number of times a sorted array is rotated. 2 | 3 | 4 | WTD: Write a function that counts the number of times a sorted array is rotated. Use binary search to identify the pivot element, which indicates the rotation count. 5 | 6 | 7 | Algorithm: Use binary search to find the pivot element. 8 | 9 | (e.g.: I/P: [15, 18, 2, 3, 6, 12]; O/P: 2) 10 | -------------------------------------------------------------------------------- /Searching/Count_array_rotations/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Count_number_occurrences/Count_number_occurrences.txt: -------------------------------------------------------------------------------- 1 | Count occurrences of a number in a sorted array. 2 | 3 | 4 | WTD: Develop a function that counts the occurrences of a given element in a sorted array. Use a modified binary search to find the first and last occurrences, then calculate the count. 5 | 6 | 7 | Algorithm: Modified binary search to find the first and last occurrences. 8 | 9 | (e.g.: I/P: [2, 2, 2, 2, 2], 2 ; O/P: 5) 10 | -------------------------------------------------------------------------------- /Searching/Count_number_occurrences/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Exponential_search/Exponential_search.txt: -------------------------------------------------------------------------------- 1 | Use exponential search to find an element in a sorted array. 2 | 3 | 4 | WTD: Develop a function that uses exponential search to find a target element in a sorted array. First exponentially grow the range where the target is likely to reside, and then apply binary search within that range. 5 | 6 | 7 | Algorithm: Exponential search involves two steps: finding a range where the element is likely to be and applying binary search. 8 | 9 | (e.g.: I/P: [1, 2, 3, 4, 5], 3 ; O/P: 2) 10 | -------------------------------------------------------------------------------- /Searching/Exponential_search/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Fibonacci_search/Fibonacci_search.txt: -------------------------------------------------------------------------------- 1 | Implement Fibonacci search on a sorted array. 2 | 3 | 4 | WTD: Create a function that uses Fibonacci search to find a target element in a sorted array. Use Fibonacci numbers to divide the array into unequal parts. 5 | 6 | 7 | Algorithm: Fibonacci search divides the array into unequal parts based on Fibonacci numbers. 8 | 9 | (e.g.: I/P: [1, 2, 3, 4, 5], 2 ; O/P: 1) 10 | -------------------------------------------------------------------------------- /Searching/Fibonacci_search/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_Kth_max_min/Find_Kth_max_min.txt: -------------------------------------------------------------------------------- 1 | Find the Kth maximum and minimum element in an array. 2 | 3 | 4 | WTD: Implement a function to find the Kth maximum and minimum element in an array. Employ QuickSelect, sorting, or a min-max heap method. 5 | 6 | 7 | Algorithm: Use QuickSelect, sorting, or min-max heap methods. 8 | 9 | (e.g.: I/P: [7, 10, 4, 3, 20, 15], K = 3; O/P: Max = 15, Min = 7) 10 | -------------------------------------------------------------------------------- /Searching/Find_Kth_max_min/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_first_last_occurrence/Find_first_last_occurrence.txt: -------------------------------------------------------------------------------- 1 | Find the first and last occurrence of an element in a sorted array. 2 | 3 | 4 | WTD: Implement a function that finds both the first and last occurrences of a given element in a sorted array. Use a modified binary search algorithm to find the initial and final positions. 5 | 6 | 7 | Algorithm: Modified binary search. 8 | 9 | (e.g.: I/P: [2, 2, 2, 2, 2], 2 ; O/P: First = 0, Last = 4) 10 | -------------------------------------------------------------------------------- /Searching/Find_first_last_occurrence/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_fixed_point/Find_fixed_point.txt: -------------------------------------------------------------------------------- 1 | Find a fixed point (value equal to index) in a given array. 2 | 3 | 4 | WTD: Write a function to find a fixed point (an element equal to its index) in a sorted array. Use binary search to efficiently find a fixed point. 5 | 6 | 7 | Algorithm: Use binary search for a sorted array. 8 | 9 | (e.g.: I/P: [-10, -5, 1, 3, 7, 9, 12, 17] ; O/P: 3) 10 | -------------------------------------------------------------------------------- /Searching/Find_fixed_point/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_majority_element/Find_majority_element.txt: -------------------------------------------------------------------------------- 1 | Find the majority element in an array, if it exists. 2 | 3 | 4 | WTD: Create a function to find the majority element in an array if it exists. Utilize the Boyer-Moore Voting Algorithm or a binary search on a sorted array. 5 | 6 | 7 | Algorithm: Use the Boyer-Moore Voting Algorithm or binary search on a sorted array. 8 | 9 | (e.g.: I/P: [3, 3, 4, 2, 4, 4, 2, 4, 4]; O/P: 4) 10 | -------------------------------------------------------------------------------- /Searching/Find_majority_element/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_missing_number_1_to_N/Find_missing_number_1_to_N.txt: -------------------------------------------------------------------------------- 1 | Find the missing number in an array of 1 to N. 2 | 3 | 4 | WTD: Create a function that finds the missing number in an array that contains numbers from 1 to N. You can use binary search or sum formula to find the missing number. 5 | 6 | 7 | Algorithm: Use binary search or mathematical formula. 8 | 9 | (e.g.: I/P: [1, 2, 4, 6, 5, 7, 8] ; O/P: 3) 10 | -------------------------------------------------------------------------------- /Searching/Find_missing_number_1_to_N/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_peak_element/Find_peak_element.txt: -------------------------------------------------------------------------------- 1 | Find a peak element in an array. 2 | 3 | 4 | WTD: Write a function to find a peak element in a given array. Use binary search to find an element that is greater than its neighbors. 5 | 6 | 7 | Algorithm: Use binary search to find a peak element. 8 | 9 | (e.g.: I/P: [1, 3, 5, 4, 2] ; O/P: 5) 10 | -------------------------------------------------------------------------------- /Searching/Find_peak_element/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_repeating_missing/Find_repeating_missing.txt: -------------------------------------------------------------------------------- 1 | Given an array of n unique numbers except for one number which is repeating and one number which is missing, find them. 2 | 3 | 4 | WTD: Develop a function that identifies one number which is repeating and one which is missing in an array of n unique numbers. Leverage XOR bitwise operation or sorting techniques. 5 | 6 | 7 | Algorithm: Use XOR bitwise operation or sorting. 8 | 9 | (e.g.: I/P: [3, 1, 3]; O/P: Repeating = 3, Missing = 2) 10 | -------------------------------------------------------------------------------- /Searching/Find_repeating_missing/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Find_smallest_missing/Find_smallest_missing.txt: -------------------------------------------------------------------------------- 1 | In a sorted array of distinct elements, find the smallest missing element. 2 | 3 | 4 | WTD: Write a function to find the smallest missing element in a sorted array of distinct elements. Use binary search to locate the smallest missing number efficiently. 5 | 6 | 7 | Algorithm: Use binary search to find the smallest missing number. 8 | 9 | (e.g.: I/P: [0, 1, 2, 6, 9]; O/P: 3) 10 | -------------------------------------------------------------------------------- /Searching/Find_smallest_missing/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Interpolation_search/Interpolation_search.txt: -------------------------------------------------------------------------------- 1 | Implement interpolation search on a sorted array. 2 | 3 | 4 | WTD: Implement a function that employs interpolation search on a sorted array to find a target element. Use a formula to guess the probable position of the target element before conducting the search. 5 | 6 | Algorithm: Interpolation search tries to find the position of the target value by using a probing formula. 7 | 8 | (e.g.: I/P: [1, 2, 3, 4, 5], 4 ; O/P: 3) 9 | -------------------------------------------------------------------------------- /Searching/Interpolation_search/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Jump_search/Jump_search.txt: -------------------------------------------------------------------------------- 1 | Implement Jump Search 2 | 3 | WTD: Write a function to implement jump search on a sorted array. Use a fixed step size to skip ahead and then perform a linear search within the step. 4 | 5 | Algorithm: Jump search skips ahead by fixed steps and performs a linear search backward. 6 | 7 | (e.g.: I/P: [1, 3, 5, 7, 9], 7 ; O/P: 3) 8 | -------------------------------------------------------------------------------- /Searching/Jump_search/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_bitonic_array/Search_bitonic_array.txt: -------------------------------------------------------------------------------- 1 | Search for an element in a bitonic array (an array that is first increasing then decreasing). 2 | 3 | 4 | WTD: Implement a function to search for an element in a bitonic array (an array that first increases and then decreases). First find the peak element, then conduct a binary search on the increasing and decreasing parts. 5 | 6 | 7 | Algorithm: First find the peak element, then perform binary search on the increasing and decreasing parts. 8 | 9 | (e.g.: I/P: [1, 3, 8, 12, 4, 2]; Search Element: 8; O/P: 2) 10 | -------------------------------------------------------------------------------- /Searching/Search_bitonic_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_nearly_sorted_array/Search_nearly_sorted_array.txt: -------------------------------------------------------------------------------- 1 | Search for an element in a nearly sorted array (elements may be swapped). 2 | 3 | 4 | WTD: Implement a function to search for an element in a nearly sorted array (where elements may be slightly out of place). Use a modified binary search algorithm. 5 | 6 | 7 | Algorithm: Modified binary search. 8 | 9 | (e.g.: I/P: [2, 1, 3, 5, 4], 2; O/P: 0) 10 | -------------------------------------------------------------------------------- /Searching/Search_nearly_sorted_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_sorted_array/Search_sorted_array.txt: -------------------------------------------------------------------------------- 1 | Search for an element in a sorted array. 2 | 3 | WTD: Implement a function that performs binary search to find a target element in a sorted array. You'll need to start by comparing the target with the middle element and adjust your search range accordingly. Divide and conquer by halving the array. 4 | 5 | Algorithm: Binary search divides the array into halves and compares the middle element to the target. 6 | 7 | (e.g.: I/P: [1, 2, 3, 4, 5], 4 ; O/P: 3) 8 | -------------------------------------------------------------------------------- /Searching/Search_sorted_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_sorted_matrix/Search_sorted_matrix.txt: -------------------------------------------------------------------------------- 1 | Search for an element in a matrix where rows and columns are sorted. 2 | 3 | 4 | WTD: Develop a function to search for an element in a matrix where the rows and columns are sorted. Start from the top-right or bottom-left corner and incrementally move toward the target. 5 | 6 | 7 | Algorithm: Start from the top-right or bottom-left corner and move towards the target. 8 | 9 | (e.g.: I/P: Matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], Search Element = 5; O/P: (1, 1)) 10 | -------------------------------------------------------------------------------- /Searching/Search_sorted_matrix/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_sorted_rotated_array/Search_sorted_rotated_array.txt: -------------------------------------------------------------------------------- 1 | Search an element in a sorted and rotated array. 2 | 3 | 4 | WTD: Develop a function that searches for an element in a sorted but rotated array. Use a modified binary search that accounts for the rotation. 5 | 6 | 7 | Algorithm: Modified binary search. 8 | 9 | (e.g.: I/P: [3, 4, 5, 1, 2], 1 ; O/P: 3) 10 | -------------------------------------------------------------------------------- /Searching/Search_sorted_rotated_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_unknown_length_array/Search_unknown_length_array.txt: -------------------------------------------------------------------------------- 1 | Given a sorted array of unknown length, find if an element exists. 2 | 3 | 4 | WTD: Write a function to find if an element exists in a sorted array of unknown length. Utilize exponential search to define a suitable range for binary search. 5 | 6 | 7 | Algorithm: Use exponential search to find the high boundary for binary search. 8 | 9 | (e.g.: I/P: [1, 2, 3, 4, 5, ....], Element = 5; O/P: 4) 10 | -------------------------------------------------------------------------------- /Searching/Search_unknown_length_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_unsorted_array/Search_unsorted_array.txt: -------------------------------------------------------------------------------- 1 | Search for an element in an unsorted array. 2 | 3 | 4 | WTD: Create a function that takes an unsorted array and a target element as input. Your task is to find the index of the target element using linear search. You can accomplish this by looping through the array and comparing each element with the target. 5 | 6 | Algorithm: Linear search sequentially checks each element until the desired element is found or the array ends. 7 | 8 | (e.g.: I/P: [5, 2, 9, 1, 5, 6], 9 ; O/P: 2) 9 | -------------------------------------------------------------------------------- /Searching/Search_unsorted_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Searching/Search_unsorted_array/Solution/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Search for an element in an unsorted array. 3 | 4 | 5 | WTD: Create a function that takes an unsorted array and a target element as input. Your task is to find the index of the target element using linear search. You can accomplish this by looping through the array and comparing each element with the target. 6 | 7 | Algorithm: Linear search sequentially checks each element until the desired element is found or the array ends. 8 | 9 | (e.g.: I/P: [5, 2, 9, 1, 5, 6], 9 ; O/P: 2) 10 | 11 | author : Vaaarad07 12 | */ 13 | 14 | #include 15 | 16 | int linsearch(int arr[], int key, int size){ 17 | for(int i = 0; i 2 -> 1 -> 5; O/P: 1 -> 2 -> 4 -> 5) 8 | -------------------------------------------------------------------------------- /Sorting/Linked_List_Insertion_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Odd_Even_Sort/Odd_Even_Sort.txt: -------------------------------------------------------------------------------- 1 | Odd-Even Sort: 2 | 3 | 4 | WTD: Sort an array using Odd-Even Sort. 5 | 6 | Odd-Even Sort: A variation of bubble sort that first sorts the odd-indexed numbers and then the even-indexed numbers. 7 | 8 | (e.g.: I/P: [3, 7, 4, 9, 5, 2, 6, 1]; O/P: [1, 2, 3, 4, 5, 6, 7, 9]) 9 | -------------------------------------------------------------------------------- /Sorting/Odd_Even_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Optimized_Bubble_Sort/Optimized_Bubble_Sort.txt: -------------------------------------------------------------------------------- 1 | Optimized Bubble Sort: 2 | 3 | WTD: Sort an array using an optimized version of bubble sort. 4 | 5 | Bubble Sort: This is a simple sorting algorithm that works by swapping adjacent elements if they are in the wrong order. The optimization stops if no swaps are made during a pass. 6 | 7 | (e.g.: I/P: [5, 2, 9, 1, 5, 6]; O/P: [1, 2, 5, 5, 6, 9]) 8 | -------------------------------------------------------------------------------- /Sorting/Optimized_Bubble_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Pancake_Sort/Pancake_Sort.txt: -------------------------------------------------------------------------------- 1 | Pancake Sort: 2 | 3 | 4 | WTD: Sort an array using Pancake Sort. 5 | 6 | Pancake Sort: This involves reversing portions of the array to sort the elements. 7 | 8 | (e.g.: I/P: [23, 15, 17, 30]; O/P: [15, 17, 23, 30]) 9 | -------------------------------------------------------------------------------- /Sorting/Pancake_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Patience_Sort/Patience_Sort.txt: -------------------------------------------------------------------------------- 1 | Patience Sort: 2 | 3 | 4 | WTD: Sort an array using Patience Sort. 5 | 6 | Patience Sort: Solitaire card game-based sorting. It sorts the array by placing elements into "piles" in ascending order. 7 | 8 | (e.g.: I/P: [2, 6, 3, 4, 1]; O/P: [1, 2, 3, 4, 6]) 9 | -------------------------------------------------------------------------------- /Sorting/Patience_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Permutation_Sort/Permutation_Sort.txt: -------------------------------------------------------------------------------- 1 | Permutation Sort: 2 | 3 | 4 | WTD: Sort an array using Permutation Sort. 5 | 6 | Permutation Sort: Generates all possible permutations of the list and checks each one to see if it's sorted. 7 | 8 | (e.g.: I/P: [12, 11, 13, 5, 6]; O/P: [5, 6, 11, 12, 13]) 9 | -------------------------------------------------------------------------------- /Sorting/Permutation_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Pigeonhole_Sort/Pigeonhole_Sort.txt: -------------------------------------------------------------------------------- 1 | Pigeonhole Sort: 2 | 3 | 4 | WTD: Sort an array of positive integers using Pigeonhole Sort. 5 | 6 | Pigeonhole Sort: Suitable for sorting elements where the range of key values is small. 7 | 8 | (e.g.: I/P: [8, 3, 2, 7, 4, 6, 8]; O/P: [2, 3, 4, 6, 7, 8, 8]) 9 | -------------------------------------------------------------------------------- /Sorting/Pigeonhole_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Radix_Sort_for_Floating_Points/Radix_Sort_for_Floating_Points.txt: -------------------------------------------------------------------------------- 1 | Radix Sort for Floating Points: 2 | 3 | 4 | WTD: Sort an array of floating-point numbers using radix sort. 5 | 6 | Radix Sort: Sorts numbers digit by digit, from the least significant digit to the most. 7 | 8 | (e.g.: I/P: [0.42, 0.32, 0.33, 0.52, 0.37, 0.47, 0.51]; O/P: [0.32, 0.33, 0.37, 0.42, 0.47, 0.51, 0.52]) 9 | -------------------------------------------------------------------------------- /Sorting/Radix_Sort_for_Floating_Points/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Recursive_Merge_Sort/Recursive_Merge_Sort.txt: -------------------------------------------------------------------------------- 1 | Recursive Merge Sort: 2 | 3 | WTD: Sort an array using recursive merge sort. 4 | 5 | Merge Sort: A divide and conquer algorithm that splits the array into halves, sorts them, and merges them back. 6 | 7 | (e.g.: I/P: [38, 27, 43, 3, 9, 82, 10]; O/P: [3, 9, 10, 27, 38, 43, 82]) 8 | -------------------------------------------------------------------------------- /Sorting/Recursive_Merge_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Sleep_Sort/Sleep_Sort.txt: -------------------------------------------------------------------------------- 1 | Sleep Sort: 2 | 3 | 4 | WTD: Sort an array using Sleep Sort. 5 | 6 | Sleep Sort: This unusual sort involves creating a separate thread for each element in the input array, where each thread sleeps for an amount of time corresponding to the value of the input element. 7 | 8 | (e.g.: I/P: [4, 3, 2, 1]; O/P: [1, 2, 3, 4]) 9 | -------------------------------------------------------------------------------- /Sorting/Sleep_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Stooge_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Stooge_Sort/Stooge_Sort.txt: -------------------------------------------------------------------------------- 1 | Stooge Sort: 2 | 3 | WTD: Sort an array using Stooge Sort. 4 | 5 | Stooge Sort: A recursive sorting algorithm that sorts first 2/3rd of the array, then last 2/3rd, and again first 2/3rd. 6 | 7 | (e.g.: I/P: [2, 4, 5, 3, 1]; O/P: [1, 2, 3, 4, 5]) 8 | -------------------------------------------------------------------------------- /Sorting/Tim_Sort/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Sorting/Tim_Sort/Tim_Sort.txt: -------------------------------------------------------------------------------- 1 | Tim Sort: 2 | 3 | 4 | WTD: Sort an array using Tim Sort. 5 | 6 | Tim Sort: A hybrid sorting algorithm derived from merge sort and insertion sort. 7 | 8 | (e.g.: I/P: [5, 21, 9, 1, 45, 15, 67]; O/P: [1, 5, 9, 15, 21, 45, 67]) 9 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Balanced_Parentheses_Stack/Balanced_Parentheses_Stack.txt: -------------------------------------------------------------------------------- 1 | Balanced Parentheses using Stack. 2 | 3 | WTD: Check for balanced parentheses in a given expression. Use a stack to keep track of opening and closing brackets, braces, and parentheses. 4 | 5 | (e.g: I/P: "{[()]}" ; O/P: Balanced) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Balanced_Parentheses_Stack/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Byte-Packing_Stack/Byte-Packing_Stack.txt: -------------------------------------------------------------------------------- 1 | Byte-Packing Stack. 2 | 3 | WTD: Design a stack that efficiently stores 8-bit data in a continuous memory space. Ensure that the 32-bit words are packed without any wastage. 4 | 5 | (e.g: I/P: Push 0x01, 0x02, 0x03, 0x04 ; O/P: Memory content - 0x04030201) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Byte-Packing_Stack/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Circular_Queue/Circular_Queue.txt: -------------------------------------------------------------------------------- 1 | Circular Queue. 2 | 3 | WTD: Develop a circular queue that overwrites the oldest elements when the queue reaches its capacity. Implement wrap-around functionality to make sure that new elements are inserted at the start of the array when the end is reached. 4 | 5 | (e.g: I/P: Enqueue 1, 2, 3, 4 (Size=3) ; O/P: 2, 3, 4) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Circular_Queue/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Command_Parser/Command_Parser.txt: -------------------------------------------------------------------------------- 1 | Command Parser. 2 | 3 | WTD: Develop a command parser using a stack that can handle nested commands. The parser should be able to distinguish between different types of commands and their nesting levels. Implement a mechanism to return the depth of the nested commands for debugging or other purposes. 4 | 5 | (e.g: I/P: "{CMD1 {CMD2}}" ; O/P: Depth - 2) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Command_Parser/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Expression_Validator/Expression_Validator.txt: -------------------------------------------------------------------------------- 1 | Expression Validator. 2 | 3 | WTD: Develop a stack-based mechanism to validate the correctness of arithmetic expressions by checking for balanced parentheses and proper operator placement. 4 | 5 | (e.g: I/P: "(a+b) * (c-d)" ; O/P: Valid Expression) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Expression_Validator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Function_Call_Logger/Function_Call_Logger.txt: -------------------------------------------------------------------------------- 1 | Function Call Logger. 2 | 3 | WTD: Implement a stack that logs function calls during the runtime of a program. This stack should allow for backtracking, enabling the user to trace the sequence of function calls and understand the flow of execution. 4 | 5 | (e.g: I/P: Call FuncA, Call FuncB, Return ; O/P: Current function - FuncA) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Function_Call_Logger/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Min-Element_Stack/Min-Element_Stack.txt: -------------------------------------------------------------------------------- 1 | Min-Element Stack. 2 | 3 | WTD: Construct a stack that can return the minimum element from the stack in constant time O(1). Use an auxiliary stack or any other data structure to keep track of the minimum element. 4 | 5 | (e.g: I/P: Push 4, Push 2, Push 8 ; O/P: Min - 2) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Min-Element_Stack/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Multi-stack_Array/Multi-stack_Array.txt: -------------------------------------------------------------------------------- 1 | Multi-stack Array. 2 | 3 | WTD: Design a system that allows multiple stacks to be stored within a single array. The space utilization should be optimized so that as one stack grows, it can acquire more space without causing overflow errors for the other stacks. 4 | 5 | (e.g: I/P: Push 1 to Stack1, Push 'a' to Stack2 ; O/P: Array - [1, 'a']) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Multi-stack_Array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Nested_Statement_Counter/Nested_Statement_Counter.txt: -------------------------------------------------------------------------------- 1 | Nested Statement Counter. 2 | 3 | WTD: Use a stack to simulate the nested structure of programming constructs like loops or if-statements, and return their depth. 4 | 5 | (e.g: I/P: { { } } ; O/P: Depth - 2) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Nested_Statement_Counter/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Palindrome_Checker/Palindrome_Checker.txt: -------------------------------------------------------------------------------- 1 | Palindrome Checker using Stack. 2 | 3 | WTD: Create a function that uses a stack to determine whether a given string is a palindrome. Push each character of the string onto a stack and then pop them off to compare with the original string. 4 | 5 | (e.g: I/P: "RACECAR" ; O/P: Palindrome) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Palindrome_Checker/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Post-order_Traversal_Stack/Post-order_Traversal_Stack.txt: -------------------------------------------------------------------------------- 1 | Post-order Traversal using Stack. 2 | 3 | WTD: Implement post-order traversal of a binary tree using a stack. Make sure to visit the left subtree, then the right subtree, and finally the root node. 4 | 5 | (e.g: I/P: Tree - 1->2->3 ; O/P: 2, 3, 1) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Post-order_Traversal_Stack/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Priority_Queue_Heap/Priority_Queue_Heap.txt: -------------------------------------------------------------------------------- 1 | Priority Queue using Heap. 2 | 3 | WTD: Create a priority queue using either a max-heap or a min-heap. Implement methods for insertion and removal of elements based on their priority. 4 | 5 | (e.g: I/P: Insert 3, Insert 1, Insert 4 ; O/P: RemoveMax - 4) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Priority_Queue_Heap/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Cache/Queue-based_Cache.txt: -------------------------------------------------------------------------------- 1 | Queue-based Cache. 2 | 3 | WTD: Implement a caching mechanism using a queue. When the cache is full, evict the least recently used item. 4 | 5 | (e.g: I/P: Cache(2), Put 1, Put 2, Get 1, Put 3 ; O/P: Cache - [1, 3]) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Cache/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Logger/Queue-based_Logger.txt: -------------------------------------------------------------------------------- 1 | Queue-based Logger. 2 | 3 | WTD: Build a queue-based logging system that logs and retrieves various system events. The queue should have a predefined size, and when it gets full, the oldest log entry should be removed to make space for a new one. 4 | 5 | (e.g: I/P: Log "Event1", Log "Event2", Retrieve ; O/P: "Event1") 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Logger/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Sequence_Generator/Queue-based_Sequence_Generator.txt: -------------------------------------------------------------------------------- 1 | Queue-based Sequence Generator. 2 | 3 | WTD: Design a queue-based system that can generate the Fibonacci sequence up to n numbers. The queue should be used to store intermediate Fibonacci numbers and help in generating subsequent numbers in the sequence. 4 | 5 | (e.g: I/P: n = 5 ; O/P: 0, 1, 1, 2, 3) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Sequence_Generator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Text_Filter/Queue-based_Text_Filter.txt: -------------------------------------------------------------------------------- 1 | Queue-based Text Filter. 2 | 3 | WTD: Develop a queue-based text filter that removes specific words from a given text string. The words to be filtered out should be enqueued and then compared against the text for filtering. 4 | 5 | (e.g: I/P: Text - "Hello world", Filter - "world" ; O/P: "Hello") 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue-based_Text_Filter/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue_Two_Priorities/Queue_Two_Priorities.txt: -------------------------------------------------------------------------------- 1 | Queue with Two Priorities. 2 | 3 | WTD: Design a queue data structure that handles two levels of priority (high and low). Ensure that elements with high priority are dequeued before those with low priority. 4 | 5 | (e.g: I/P: Enqueue 1 (High), Enqueue 2 (Low) ; O/P: Dequeue - 1) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue_Two_Priorities/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue_from_Stacks/Queue_from_Stacks.txt: -------------------------------------------------------------------------------- 1 | Queue from Stacks. 2 | 3 | WTD: Implement a queue using two stacks. Use one stack for enqueuing and another for dequeuing. Make sure the oldest element gets dequeued. 4 | 5 | (e.g: I/P: Enqueue 1, Enqueue 2 ; O/P: Dequeue - 1) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Queue_from_Stacks/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Radix_Sort_Queue/Radix_Sort_Queue.txt: -------------------------------------------------------------------------------- 1 | Radix Sort using Queue. 2 | 3 | WTD: Implement Radix Sort using a queue. Use additional queues to sort each digit from the least significant to the most significant. 4 | 5 | (e.g: I/P: [170, 45, 75, 90, 802, 24, 2, 66] ; O/P: [2, 24, 45, 66, 75, 90, 170, 802]) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Radix_Sort_Queue/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Recursive_to_Iterative_Converter/Recursive_to_Iterative_Converter.txt: -------------------------------------------------------------------------------- 1 | Recursive to Iterative Converter. 2 | 3 | WTD: Create a function that uses a stack to convert a recursive algorithm into its iterative version. For example, convert a recursive Fibonacci function into an iterative one that uses a stack for storage. 4 | 5 | (e.g: I/P: Fibonacci(5) ; O/P: 5) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Recursive_to_Iterative_Converter/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Stack-based_Calculator/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Stack-based_Calculator/Stack-based_Calculator.txt: -------------------------------------------------------------------------------- 1 | Stack-based Calculator. 2 | 3 | WTD: Build a simple calculator to evaluate postfix expressions. Use a stack to keep track of operands and apply operators as they appear. 4 | 5 | (e.g: I/P: "5 1 2 + 4 * + 3 -" ; O/P: 14) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Stack-based_Text_Editor/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Stack-based_Text_Editor/Stack-based_Text_Editor.txt: -------------------------------------------------------------------------------- 1 | Stack-based Text Editor. 2 | 3 | WTD: Design a text editor that uses a stack to implement basic text editing features like undo and redo. Each operation should push the current state of the text onto the stack, allowing for easy rollback or re-application of changes. 4 | 5 | (e.g: I/P: Add "Hello", Undo, Add "Hi" ; O/P: "Hi") 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Stack_Sorting/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Stack_Sorting/Stack_Sorting.txt: -------------------------------------------------------------------------------- 1 | Stack Sorting. 2 | 3 | WTD: Design a method to sort a stack. You are allowed to use only one additional stack as a temporary storage. No other data structures should be used. 4 | 5 | (e.g: I/P: Stack - [4, 3, 1] ; O/P: Stack - [1, 3, 4]) 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/String_Message_Queue/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/String_Message_Queue/String_Message_Queue.txt: -------------------------------------------------------------------------------- 1 | String Message Queue. 2 | 3 | WTD: Implement a queue that specializes in storing and retrieving string messages in a FIFO manner. 4 | 5 | (e.g: I/P: Enqueue "HELLO", Enqueue "WORLD" ; O/P: Dequeue - "HELLO", Dequeue - "WORLD") 6 | -------------------------------------------------------------------------------- /Stacks_and_Queues/Undo_Redo_Stack/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Stacks_and_Queues/Undo_Redo_Stack/Undo_Redo_Stack.txt: -------------------------------------------------------------------------------- 1 | Undo and Redo Stack. 2 | 3 | WTD: Implement a system that allows for undo and redo operations. Use two stacks to keep track of all states, one for undo and another for redo. 4 | 5 | (e.g: I/P: Write "Hello", Undo, Write "Hi" ; O/P: "Hi") 6 | -------------------------------------------------------------------------------- /Strings/Alphabetically_Encoding_a_String/Alphabetically_Encoding_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: String Encoding. 2 | WTD: : Encode a string by replacing each character with the third character after it in the alphabet. Wrap around to the start of the alphabet after 'z'. 3 | e.g.: I/P: "abc", O/P: "def" -------------------------------------------------------------------------------- /Strings/Alphabetically_Encoding_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. 2 | -------------------------------------------------------------------------------- /Strings/Checking_Anagrams_Between_Two_Strings/Checking_Anagrams_Between_Two_Strings.txt: -------------------------------------------------------------------------------- 1 | Check for Pangram 2 | 3 | WTD: Determine if the given string contains every letter of the alphabet at least once. For instance, "The quick brown fox jumps over a lazy dog" is a pangram. 4 | (e.g.: I/P: "Jinxed wizards pluck ivy from the big quilt"; O/P: True) 5 | -------------------------------------------------------------------------------- /Strings/Checking_Anagrams_Between_Two_Strings/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Counting_Balanced_Zero-One_Substrings/Counting_Balanced_Zero-One_Substrings.txt: -------------------------------------------------------------------------------- 1 | Problem: Count Substrings with Equal 0s and 1s. 2 | WTD: Given a binary string, count the number of substrings that have an equal number of 0s and 1s. For "0011", the answer is 4: "00", "11", "0011", and "01". 3 | e.g.: I/P: "0101", O/P: 4 4 | -------------------------------------------------------------------------------- /Strings/Counting_Balanced_Zero-One_Substrings/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Counting_Character_Occurrences_in_a_String/Counting_Character_Occurrences_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Count the occurrences of a given character in a string. 2 | WTD: Count how many times a specified character appears in a given string. 3 | e.g.: I/P: "apple", Char: 'p', O/P: "2" -------------------------------------------------------------------------------- /Strings/Counting_Character_Occurrences_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Counting_Substring_Occurrences_in_a_String/Counting_Substring_Occurrences_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Substring Count. 2 | WTD: Find out how many times a particular substring appears in the given string. 3 | e.g.: I/P: Main String: "banana", Substring: "ana", O/P: "1" -------------------------------------------------------------------------------- /Strings/Counting_Substring_Occurrences_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Counting_Vowels_and_Consonants_in_a_String/Counting_Vowels_and_Consonants_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Count the number of vowels and constants in a given string. 2 | WTD: Tally the number of vowel and consonant characters in the given string. 3 | e.g.: I/P: "apple", O/P: Vowels: 2, Consonants: 3 -------------------------------------------------------------------------------- /Strings/Counting_Vowels_and_Consonants_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Discovering_the_Longest_Palindromic_Substring/Discovering_the_Longest_Palindromic_Substring.txt: -------------------------------------------------------------------------------- 1 | Problem: Find the longest palindrome substring in a given string. 2 | WTD: Find the length of the longest substring without repeating characters. For "abcabcbb", the answer would be 3, because the longest substring without repeating letters is "abc". 3 | (e.g.: I/P: "pwwkew"; O/P: 3) 4 | -------------------------------------------------------------------------------- /Strings/Discovering_the_Longest_Palindromic_Substring/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Evaluating_Repeated_Substring_Patterns/Evaluating_Repeated_Substring_Patterns.txt: -------------------------------------------------------------------------------- 1 | Problem: Repeated Substring Pattern. 2 | WTD: Determine if a given string can be constructed by taking a substring of it and appending multiple copies of the substring together. 3 | e.g.: I/P: "abab", O/P: True (Because "ab" is repeated) 4 | -------------------------------------------------------------------------------- /Strings/Evaluating_Repeated_Substring_Patterns/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Evaluating_String_Interleaving/Evaluating_String_Interleaving.txt: -------------------------------------------------------------------------------- 1 | Problem: String Interleaving. 2 | WTD: Determine if a given string is an interleaving of two other strings. 3 | e.g.: I/P: Strings: "xyz", "789", Interleaved: "x7y8z9", O/P: True -------------------------------------------------------------------------------- /Strings/Evaluating_String_Interleaving/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Finding_Lexicographically_Minimal_String_Rotation/Finding_Lexicographically_Minimal_String_Rotation.txt: -------------------------------------------------------------------------------- 1 | Problem: Find Lexicographically Minimal Rotation. 2 | WTD: Determine the lexicographically smallest rotation of a string. 3 | e.g.: I/P: "dacb", O/P: "acbd" 4 | -------------------------------------------------------------------------------- /Strings/Finding_Lexicographically_Minimal_String_Rotation/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Finding_the_First_Unique_Character_in_a_String/Finding_the_First_Unique_Character_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Print the first non-repeated character from a string. 2 | WTD: Examine the string and pinpoint the very first character that doesn't repeat elsewhere in the string. 3 | e.g.: I/P: "swiss", O/P: "w" -------------------------------------------------------------------------------- /Strings/Finding_the_First_Unique_Character_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Finding_the_Most_Frequent_Character/Finding_the_Most_Frequent_Character.txt: -------------------------------------------------------------------------------- 1 | Problem: Maximum Occurring Character. 2 | WTD: Determine which character in a string appears the most times. 3 | e.g.: I/P: "success", O/P: "s" -------------------------------------------------------------------------------- /Strings/Finding_the_Most_Frequent_Character/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Generating_All_String_Permutations/Generating_All_String_Permutations.txt: -------------------------------------------------------------------------------- 1 | Problem: Find all permutations of a string. 2 | WTD: Generate all possible arrangements of the characters from the given string. 3 | e.g.: I/P: "ab", O/P: "ab", "ba" -------------------------------------------------------------------------------- /Strings/Generating_All_String_Permutations/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Identifying_Duplicate_Characters_in_a_String/Identifying_Duplicate_Characters_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Print Duplicate characters from a string. 2 | WTD: Traverse through the given string and identify characters that appear more than once. 3 | e.g.: I/P: "apple", O/P: "p" -------------------------------------------------------------------------------- /Strings/Identifying_Duplicate_Characters_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Identifying_Duplicate_Characters_in_a_String/Solutions/main.c: -------------------------------------------------------------------------------- 1 | /* Problem: Print Duplicate characters from a string. 2 | WTD: Traverse through the given string and identify characters that appear more than once. 3 | e.g.: I/P: "apple", O/P: "p" */ 4 | 5 | #include 6 | #include 7 | 8 | void duplicateChar(char *str){ 9 | 10 | int freq[26] = {0}; // to keep count of characters 11 | bool printed[26] = {false}; // to check if the character is already printed or not 12 | 13 | while(*str != '\0'){ //iterating through the string 14 | freq[*str-'a']++; //count of each character 15 | 16 | if(freq[*str-'a']>=2 && !printed[*str-'a']){ 17 | printf("%c ",*str); 18 | printed[*str-'a'] = true; 19 | } 20 | str++; 21 | } 22 | } 23 | 24 | int main(){ 25 | 26 | char str[100]; 27 | 28 | printf("Enter the string: "); 29 | scanf("%s", str); 30 | 31 | duplicateChar(str); 32 | 33 | return 0; 34 | } -------------------------------------------------------------------------------- /Strings/Identifying_Longest_Substring_Without_Repeats/Identifying_Longest_Substring_Without_Repeats.txt: -------------------------------------------------------------------------------- 1 | Problem: Longest Substring Without Repeating Characters. 2 | WTD: Find the length of the longest substring without repeating characters. 3 | e.g.: I/P: "pwwkew", O/P: 3 -------------------------------------------------------------------------------- /Strings/Identifying_Longest_Substring_Without_Repeats/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Listing_Multiple_Occurrences_of_Characters_in_a_String/Listing_Multiple_Occurrences_of_Characters_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Duplicate characters found in a string. 2 | WTD: Spot all characters in the string that appear more than once and list them. 3 | e.g.: I/P: "programming", O/P: "r", "g", "m" -------------------------------------------------------------------------------- /Strings/Listing_Multiple_Occurrences_of_Characters_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Minimizing_Palindromic_Partitions/Minimizing_Palindromic_Partitions.txt: -------------------------------------------------------------------------------- 1 | Problem: Palindrome Partitioning. 2 | WTD: Partition a string such that every substring of the partition is a palindrome. 3 | e.g.: I/P: "aab", O/P: 1 (The string can be split as ["aa","b"]) -------------------------------------------------------------------------------- /Strings/Minimizing_Palindromic_Partitions/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Palindrome_Validation_for_Strings/Palindrome_Validation_for_Strings.txt: -------------------------------------------------------------------------------- 1 | Problem: Check if a given string is a palindrome. 2 | WTD: Ascertain if the provided string reads the same forwards and backwards. 3 | e.g.: I/P: "radar", O/P: "True" -------------------------------------------------------------------------------- /Strings/Palindrome_Validation_for_Strings/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Pangram_Verification/Pangram_Verification.txt: -------------------------------------------------------------------------------- 1 | Problem: Check for Pangram. 2 | WTD: Determine if the given string contains every letter of the alphabet at least once. 3 | e.g.: I/P: "Jinxed wizards pluck ivy from the big quilt", O/P: True 4 | -------------------------------------------------------------------------------- /Strings/Pangram_Verification/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Recursive_String_Reversal/Recursive_String_Reversal.txt: -------------------------------------------------------------------------------- 1 | Problem: Reverse a string using recursion. 2 | WTD: Use a recursive method to invert the order of characters in a string. 3 | e.g.: I/P: "hello", O/P: "olleh" -------------------------------------------------------------------------------- /Strings/Recursive_String_Reversal/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Reversing_Words_in_a_Sentence_Without_Libraries/Reversing_Words_in_a_Sentence_Without_Libraries.txt: -------------------------------------------------------------------------------- 1 | Problem: Reverse words in a given sentence without using any library method. 2 | WTD: Invert the order of words in a given sentence, maintaining the order of characters within each word. 3 | e.g.: I/P: "Hello Word", O/P: "World Hello" -------------------------------------------------------------------------------- /Strings/Reversing_Words_in_a_Sentence_Without_Libraries/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/String-to-Integer_Conversion_Without_Built-in_Functions/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/String-to-Integer_Conversion_Without_Built-in_Functions/Solutions/main.c: -------------------------------------------------------------------------------- 1 | /* Problem: Convert a string to its integer representation without using any built-in functions. 2 | WTD: Transform a given string of numeric characters into its corresponding integer representation without relying on built-in methods. 3 | e.g.: I/P: "1234", O/P: 1234 */ 4 | 5 | #include 6 | 7 | //function to convert string to integer 8 | int strToInt(char *str, int num){ 9 | while(*str != '\0'){ 10 | num = num * 10 + (*str - 48); // convertint each string character to int and storing it in num 11 | str++; 12 | } 13 | return num; // returning the int value 14 | } 15 | 16 | int main(){ 17 | 18 | char *str = "1234"; 19 | int res = 0, num = 0; 20 | 21 | res = strToInt(str,num); 22 | 23 | printf("The converted result is: %d",res); 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /Strings/String-to-Integer_Conversion_Without_Built-in_Functions/String-to-Integer_Conversion_Without_Built-in_Functions.txt: -------------------------------------------------------------------------------- 1 | Problem: Convert a string to its integer representation without using any built-in functions. 2 | WTD: Transform a given string of numeric characters into its corresponding integer representation without relying on built-in methods. 3 | e.g.: I/P: "1234", O/P: 1234 -------------------------------------------------------------------------------- /Strings/Validating_Balanced_Parentheses_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Validating_Balanced_Parentheses_in_a_String/Validating_Balanced_Parentheses_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Check if a string has balanced parentheses. 2 | WTD: Ensure that for every opening bracket, parenthesis, or brace in the string, there's a corresponding closing counterpart, and they are correctly nested. 3 | e.g.: I/P: "()[{}]", O/P: "True" -------------------------------------------------------------------------------- /Strings/Verifying_Numeric-only_Characters_in_a_String/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Verifying_Numeric-only_Characters_in_a_String/Verifying_Numeric-only_Characters_in_a_String.txt: -------------------------------------------------------------------------------- 1 | Problem: Check if the string contains only digits. 2 | WTD: Determine if all characters in the provided string are numeric digits. 3 | e.g.: I/P: "1234a", O/P: "False" -------------------------------------------------------------------------------- /Strings/Verifying_String_Rotations/Solutions/README.md: -------------------------------------------------------------------------------- 1 | You can post your solutions in this folder. -------------------------------------------------------------------------------- /Strings/Verifying_String_Rotations/Verifying_String_Rotations.txt: -------------------------------------------------------------------------------- 1 | Problem: Check if two strings are a rotation of each other. 2 | WTD: Verify if one string can be obtained by rotating another string, indicating how many positions were involved in the rotation. 3 | e.g.: I/P: "abcde" "cdeab", O/P: "Rotation: 2L" -------------------------------------------------------------------------------- /Structures_and_Unions/32bit_value_access/32bit_value_access.txt: -------------------------------------------------------------------------------- 1 | Use a union to represent a 32-bit value that can be accessed as either two 16-bit values or four 8-bit values. 2 | 3 | WTD: Implement a union that can hold a 32-bit numerical value. This union should allow for access to the stored number as either two separate 16-bit values or as four distinct 8-bit values. 4 | 5 | (e.g: I/P: Value: 0xABCD1234; O/P: 16-bits: 0xABCD, 0x1234; 8-bits: 0xAB, 0xCD, 0x12, 0x34 ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/32bit_value_access/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/3D_point_distance/3D_point_distance.txt: -------------------------------------------------------------------------------- 1 | Define a structure to represent a 3D point in space. Write functions to calculate the distance between two points. 2 | 3 | WTD: Design a structure to model a 3D point in space. Develop functions that calculate the Euclidean distance between any two given points using the standard distance formula. 4 | Use Distance formula D= Sqrt( (x2-x1)^2 + (y2-y1)^2 + ( z2-z1)^2)) 5 | 6 | (e.g: I/P P1(1.0,2.0,3.0), P2(4.0,6.0,8.0); O/P is Distance= 7.071 ) 7 | 8 | -------------------------------------------------------------------------------- /Structures_and_Unions/3D_point_distance/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/4byte_value_conversion/4byte_value_conversion.txt: -------------------------------------------------------------------------------- 1 | Use a union to interpret a 4-byte array as an integer and a floating-point number. 2 | 3 | WTD: Design a union that is capable of holding a 4-byte array. This union should facilitate the interpretation of this array in two ways: as an integral value and as a floating-point number. 4 | 5 | (e.g: I/P: Bytes: [0x43, 0x48, 0x00, 0x00]; O/P: Float: 134.0 ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/4byte_value_conversion/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/IP_address_conversion/IP_address_conversion.txt: -------------------------------------------------------------------------------- 1 | Create a union that can hold an IP address as a string and as four separate byte values. Implement functions to convert between the two representations. 2 | 3 | WTD: Implement a union capable of storing an IP address. This union should support two representations of the IP: as a singular string and as its four byte-wise components. Design functions that facilitate conversions between these representations. 4 | 5 | (e.g: I/P: String: "10.0.0.1"; O/P: Bytes: 10, 0, 0, 1 ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/IP_address_conversion/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/IP_address_representation/IP_address_representation.txt: -------------------------------------------------------------------------------- 1 | Create a union to hold an IP address both as a string (like "192.168.1.1") and as four separate byte values. 2 | 3 | WTD: Create a union that can house an IP address. This union should support dual representations: as a singular cohesive string and as its constituent byte values. 4 | 5 | (e.g: I/P: IP String: "10.0.2.15"; O/P: Octets: [10, 0, 2, 15]) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/IP_address_representation/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/book_price_discount/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/book_price_discount/book_price_discount.txt: -------------------------------------------------------------------------------- 1 | Create a structure for a book with title, author, and price. Implement a function to discount the book's price by a given percentage. 2 | 3 | WTD: Design a function that applies a specified discount percentage to the book's price, updating its value accordingly. 4 | 5 | (e.g: I/P: Title: "Pride and Prejudice", Author: "Austen", Price: $30, Discount: 15%; O/P: New Price: $25.5 ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/color_RGB_CMYK/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/color_RGB_CMYK/color_RGB_CMYK.txt: -------------------------------------------------------------------------------- 1 | Create a structure that can represent a color in both RGB and CMYK formats. Use a union to switch between the RGB representation and the CMYK representation. 2 | 3 | WTD: Formulate a structure capable of representing color information. This structure should support dual representations: in RGB format and in CMYK format. Using a union, ensure seamless switching between these two representations. 4 | 5 | (e.g: I/P: Color Type: RGB, RGB: [255, 0, 128]; O/P: RGB Color: [255, 0, 128]) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/command_parsing/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/command_parsing/command_parsing.txt: -------------------------------------------------------------------------------- 1 | Design a structure to represent a command and its associated parameters. Implement a function to parse a string command into this structure. ( Structure for Command Parsing) 2 | 3 | WTD: Formulate a structure that captures a command and any associated parameters. Introduce a function capable of parsing a string-based command and populating this structure with the relevant details. 4 | 5 | (e.g: I/P: String: "JUMP 20"; O/P: Command: JUMP, Param: 20 ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/complex_number_operations/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/complex_number_operations/complex_number_operations.txt: -------------------------------------------------------------------------------- 1 | Define a structure for a complex number. Implement functions for addition, subtraction, multiplication, and division of two complex numbers. 2 | 3 | WTD: Design a structure to represent a complex number. Develop a suite of functions that allow for mathematical operations on complex numbers, including addition, subtraction, multiplication, and division. 4 | 5 | (e.g: I/P: Complex1: 4+5i, Complex2: 2+3i, SUB; O/P: Result: 2+2i ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/data_packet_serialization/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/data_packet_serialization/data_packet_serialization.txt: -------------------------------------------------------------------------------- 1 | Create a structure to represent serialized data packets with fields like header, payload, and checksum. Implement functions to serialize and deserialize data. 2 | 3 | WTD: Construct a structure that represents serialized data packets, detailing elements like header, payload, and checksum. Develop accompanying functions that enable the serialization of this structured data into a string and its subsequent deserialization back into the structure. 4 | 5 | (e.g: I/P: Header: 0x1234, Payload: [0xAA, 0xBB, 0xCC], Checksum: 0xABCD; O/P: Serialized: [0x12, 0x34, 0xAA, 0xBB, 0xCC, 0xAB, 0xCD]) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/date_difference/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/date_difference/date_difference.txt: -------------------------------------------------------------------------------- 1 | Implement a function that takes two date structures (day, month, year) and returns the difference in days. ( Passing Structures to Functions) 2 | 3 | WTD: Develop a function that accepts two date structures, each detailing the day, month, and year. This function should compute and return the difference between these dates in terms of days. 4 | 5 | (e.g: I/P: Date1: 15/02/2020, Date2: 20/02/2020; O/P: Diff: 5 days ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/device_config_bitfields/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/device_config_bitfields/device_config_bitfields.txt: -------------------------------------------------------------------------------- 1 | Define a structure with bit fields to represent a set of configurations/settings for a device. ( Bit Fields for compact Structure) 2 | 3 | WTD: Construct a structure with bit fields to efficiently represent a device's varied configurations or settings in a compact manner. 4 | 5 | (e.g: I/P: Config: 1001; O/P: Setting 1 & 4: ON ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/employee_address/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/employee_address/employee_address.txt: -------------------------------------------------------------------------------- 1 | Design a structure for an employee with an embedded structure for address (street, city, state, zip). ( Nested Structure) 2 | 3 | WTD: Within this structure, embed another structure specifically meant for the employee's address details, capturing street, city, state, and zip code. Ensure capabilities to extract and display this address in a coherent format. 4 | 5 | (e.g: I/P: Name: "Bob", Address: [Street: "456 Maple Rd", City: "Brookfield", State: "WI", Zip: "53005"]; O/P: Address: 456 Maple Rd, Brookfield, WI, 53005) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/endianness_conversion/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/endianness_conversion/endianness_conversion.txt: -------------------------------------------------------------------------------- 1 | Use a union to convert endianness (big-endian to little-endian and vice versa) of an integer. 2 | 3 | WTD: Implement a union that can hold an integer value. Use this union to facilitate endianness conversion, toggling between big-endian and little-endian representations of the integer. 4 | 5 | (e.g: I/P: Int: 0xAABBCCDD; O/P: Converted: 0xDDCCBBAA ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/error_code_representation/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/error_code_representation/error_code_representation.txt: -------------------------------------------------------------------------------- 1 | Define a structure for representing time (hours, minutes, seconds). Implement functions to add time durations and convert this duration to seconds. 2 | 3 | WTD: Define a structure that models time, detailing hours, minutes, and seconds. Introduce functions that can sum two time durations and also convert a given duration into its equivalent representation in seconds. 4 | 5 | (e.g: I/P: Time1: 1h 20m, Time2: 0h 50m; O/P: Sum: 2h 10m, Seconds: 7800s ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/file_attributes/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/file_attributes/file_attributes.txt: -------------------------------------------------------------------------------- 1 | Create a structure to simulate file attributes like name, type (using enum), size, and creation date (use the Date structure from problem 2). 2 | 3 | WTD: Implement a structure that simulates file attributes. This structure should capture details like the file's name, its type (represented using an enum), its size in bytes, and its creation date (leveraging a previously defined Date structure). 4 | 5 | (e.g: I/P: Name: "document.txt", Type: Document, Size: 1024 bytes, Creation Date: 2023-08-29; O/P: File: "document.txt", Type: Document, Size: 1024 bytes, Created on: 2023-08-29) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/library_database/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/library_database/library_database.txt: -------------------------------------------------------------------------------- 1 | Implement a mini database for a library using an array of structures. Include functionalities like adding a new book and searching for a book by title. ( Array of Structures) 2 | 3 | WTD: Develop a basic book database for a library using an array of structures. This database should support operations like the addition of new books and title-based book searches. 4 | 5 | (e.g: I/P: Add: "To Kill a Mockingbird", Search: "Mockingbird"; O/P: Found: "To Kill a Mockingbird" ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/menu_item_function_pointer/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/menu_item_function_pointer/menu_item_function_pointer.txt: -------------------------------------------------------------------------------- 1 | Create a structure representing a menu item with a name (string) and an associated function pointer to execute when the menu item is selected.( Function pointer in structures) 2 | 3 | WTD: Define a structure that models a menu item. Each menu item should have a name (a string) and an associated function pointer. This function pointer should point to the action to be executed when the menu item is selected. 4 | 5 | (e.g: I/P: Select: "Option2"; O/P: "Option2 Executed" ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/network_packet_type/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/network_packet_type/network_packet_type.txt: -------------------------------------------------------------------------------- 1 | Define a structure for a network packet, which includes an enum to represent packet type (e.g., DATA, ACK, NACK). ( Enum with structures) 2 | 3 | WTD: Design a structure to represent a network packet. This structure should incorporate an enum to denote the packet type, which could be values like DATA, ACK, or NACK. 4 | 5 | (e.g: I/P: Packet: ACK; O/P: This is an ACK packet ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/structure_memory_optimization/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/structure_memory_optimization/structure_memory_optimization.txt: -------------------------------------------------------------------------------- 1 | Define a structure and determine its memory size. Rearrange its members to minimize memory wastage due to alignment. ( Structure Memory Alignment) 2 | 3 | WTD: Construct a structure and evaluate its memory consumption. Reorganize the structure's components in a manner that minimizes memory wastage due to alignment constraints inherent in system architecture. 4 | 5 | (e.g: I/P: Structure: int, char, short; O/P: Memory: 11 bytes; Optimized: 10 bytes ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/student_avg_marks/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/student_avg_marks/student_avg_marks.txt: -------------------------------------------------------------------------------- 1 | Define a structure for a student with name, roll number, and marks in 5 subjects. Calculate the average marks for a list of students. ( Structure with Arrays). 2 | 3 | WTD: Construct a structure that encapsulates a student's details, specifically their name, roll number, and scores in five subjects. Implement a function that computes the average marks for an array of student structures. 4 | 5 | (e.g: I/P: Name: "Alex", Roll: 105, Marks: [75, 80, 88, 82, 86]; O/P: Avg Marks: 82.2) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/student_linked_list/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/student_linked_list/student_linked_list.txt: -------------------------------------------------------------------------------- 1 | Create a linked list of students using structures and dynamic memory allocation. ( Dynamic Memory with Structures) 2 | 3 | WTD: Implement a linked list that represents student records. For this purpose, use structures combined with dynamic memory allocation techniques. Ensure the capability to append new student records to the list. 4 | 5 | (e.g: I/P: Add Student: "Mia", Roll: 110; O/P: Student Mia, Roll: 110 Added ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/time_operations/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/time_operations/time_operations.txt: -------------------------------------------------------------------------------- 1 | Define a structure for representing time (hours, minutes, seconds). Implement functions to add time durations and convert this duration to seconds. 2 | 3 | WTD: Define a structure that models time, detailing hours, minutes, and seconds. Introduce functions that can sum two time durations and also convert a given duration into its equivalent representation in seconds. 4 | 5 | (e.g: I/P: Time1: 1h 20m, Time2: 0h 50m; O/P: Sum: 2h 10m, Seconds: 7800s ) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/variable_data_type_array/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/variable_data_type_array/variable_data_type_array.txt: -------------------------------------------------------------------------------- 1 | Implement a structure that can store an array of data. However, the data type can vary - it could be an array of integers, floats, or characters. Use a union to manage this variability. 2 | 3 | WTD: Design a structure with the ability to store an array of data. To accommodate different data types for the array (like integers, floats, or characters), use a union. Ensure mechanisms to correctly identify and retrieve the stored data type. 4 | 5 | (e.g: I/P: DataType: Integer, Data: [1, 2, 3, 4, 5]; O/P: Array of Integers: [1, 2, 3, 4, 5]) 6 | -------------------------------------------------------------------------------- /Structures_and_Unions/vehicle_extended_structure/Solution/README.md: -------------------------------------------------------------------------------- 1 | You can push your solutions here. -------------------------------------------------------------------------------- /Structures_and_Unions/vehicle_extended_structure/vehicle_extended_structure.txt: -------------------------------------------------------------------------------- 1 | Create a base structure for a vehicle with attributes like weight and max_speed. Extend this to derive structures for a car (with attributes like seating capacity) and a truck (with attributes like max_load) ( Structure Inheritance) 2 | 3 | WTD: Establish a base structure to depict a vehicle, detailing attributes like its weight and maximum speed. Extend this base to derive specialized structures for different vehicle types like cars (with attributes like seating capacity) and trucks (with features like maximum load capacity). 4 | 5 | (e.g: I/P: Truck, Weight: 8000kg, Speed: 120km/h, Load: 5000kg; O/P: Can load up to 5000kg ) 6 | --------------------------------------------------------------------------------