├── .gitignore ├── .gitmodules ├── Batch 5 ├── Algorithm │ ├── Week 04 Special Recap Session │ │ ├── CSES_Road_Reparation.cpp │ │ ├── bfs_path_printing.cpp │ │ └── topics.txt │ ├── Week 1-1 │ │ ├── 0_index.txt │ │ ├── 1_vectorOfvector.cpp │ │ ├── 2_arrayOfvector.cpp │ │ ├── M-1 Variation-of-Graph.pdf │ │ └── M-2 Representation-of-Graph.pdf │ ├── Week 1-2 │ │ ├── 0_index.txt │ │ ├── Counting_countries_using_BFS.cpp │ │ ├── Counting_countries_using_DFS.cpp │ │ ├── shortest_route.cpp │ │ ├── topics.txt │ │ └── visit_kora_jabe_kina.cpp │ ├── Week 2-1 │ │ ├── 0_index.txt │ │ └── 1_main.cpp │ ├── Week 2-2 │ │ ├── Minimum Knight Moves.bin │ │ ├── Minimum Knight Moves.cpp │ │ ├── Network_delay_time.cpp │ │ ├── Shortest_Routes_2.bin │ │ └── Shortest_Routes_2.cpp │ ├── Week 3-1 │ │ └── 0_main.cpp │ ├── Week 3-2 │ │ ├── Building_roads.cpp │ │ ├── Labyrinth.cpp │ │ ├── Road_construction.cpp │ │ └── dsu_by_size.cpp │ ├── Week 5-1 │ │ ├── W_Reach_Value.bin │ │ ├── W_Reach_Value.cpp │ │ ├── climbing_stairs.cpp │ │ ├── fibo.bin │ │ ├── fibo_bottom-up.bin │ │ ├── fibo_bottom-up.cpp │ │ ├── fibo_top-down.cpp │ │ └── house_robber.cpp │ └── Week 5-2 │ │ ├── 1_Subset_sum.cpp │ │ ├── 2_Partition Equal Subset Sum.cpp │ │ └── 3_Target_sum.cpp ├── C++ │ ├── C++ 2-2 │ │ ├── Find_Ratul.cpp │ │ ├── Find_Ratul.exe │ │ ├── input.txt │ │ ├── project.cpp │ │ ├── project.exe │ │ ├── project_test.exe │ │ ├── reverse_object.cpp │ │ └── reverse_object.exe │ ├── Week 1-1 │ │ ├── 1_Introduction.cpp │ │ ├── 2_Pointer.cpp │ │ ├── 3_hack.c │ │ ├── 4_DM_declraration.cpp │ │ ├── 5_DM_array_size_increase.cpp │ │ ├── 6_return_array_from_funciton.cpp │ │ └── test.cpp │ └── Week 2-2 │ │ ├── 0_index.txt │ │ ├── Q_Reverse_Words.cpp │ │ ├── replaceWord.cpp │ │ ├── test.cpp │ │ └── wordFind.cpp ├── C │ ├── Week 3-1 │ │ ├── 0_index.txt │ │ └── code.txt │ ├── Week 3-2 │ │ ├── 0_index.txt │ │ ├── 1_nth_largest_value.c │ │ ├── 2_coutn_letters.c │ │ └── 2_duplicate.c │ ├── Week 4-1 │ │ ├── 1_index.txt │ │ ├── 2_Introdunciton.c │ │ ├── 3_Return_Argumnt.c │ │ ├── 4_No_Return_Argumnt.c │ │ ├── 5_Return_No_Argumnt.c │ │ ├── 6_No_Return_No_Argumnt.c │ │ ├── 7_Problem_Solving.c │ │ └── doc_link.txt │ ├── Week 4-2 │ ├── Week 5-1 │ │ ├── 0 DocLink.txt │ │ ├── A_Print_Recursion.c │ │ ├── B_Print_from_1_to_N.c │ │ ├── C_Print_from_N_to_1.c │ │ └── test.c │ └── Week 5-2 │ │ ├── 2d_array.c │ │ ├── A_Beautiful_Matrix.bin │ │ ├── A_Beautiful_Matrix.c │ │ ├── F_Fox_And_Snake.bin │ │ ├── F_Fox_And_Snake.c │ │ ├── first_row_first_col.bin │ │ ├── first_row_first_col.c │ │ ├── first_row_first_col.exe │ │ ├── rahim_vs_karim.bin │ │ ├── rahim_vs_karim.c │ │ ├── sorting.bin │ │ └── sorting.c ├── DS │ ├── Week 1-1 │ │ └── G_Summation_from_1_to_N.cpp │ ├── Week 1-2 │ │ ├── E_Lowest_Number.cpp │ │ ├── Mod_2_Prac_6.bin │ │ ├── Mod_2_Prac_6.cpp │ │ ├── binary_search.bin │ │ ├── binary_search.cpp │ │ ├── prefix_sum.bin │ │ ├── prefix_sum.cpp │ │ ├── replace_and_find.bin │ │ ├── replace_and_find.cpp │ │ ├── vector.bin │ │ ├── vector.exe │ │ ├── vector_erase.bin │ │ ├── vector_erase.cpp │ │ └── vector_insert.cpp │ ├── Week 2-1 │ │ ├── 0_index.txt │ │ ├── 1_create_node.cpp │ │ ├── 2_constructor_node.cpp │ │ ├── 3_dynamic_node.cpp │ │ ├── 4_dynamic_constructor_node.cpp │ │ ├── 5_user_input.cpp │ │ └── insert_Vs_delete.cpp │ ├── Week 2-2 │ │ ├── delete_specific_value.cpp │ │ ├── min_max.cpp │ │ ├── palindrom_ll.cpp │ │ ├── searching_in_ll.cpp │ │ └── snippet.txt │ ├── Week 3-1 │ │ ├── 0_index.txt │ │ ├── 1_index.cpp │ │ └── 2_browserHistory.cpp │ ├── Week 3-2 │ │ ├── Conceptual Session Problem list 03_07.docx │ │ ├── Convert-binary-number-in-a-linked-list-to-integer.cpp │ │ ├── Intersection-of-two-linked-lists.cpp │ │ ├── Merge-in-between-linked-lists.cpp │ │ ├── Swap-nodes-in-pairs.cpp │ │ └── gcd.cpp │ ├── Week 4-1 │ │ ├── 0_index.txt │ │ ├── backsapce.cpp │ │ ├── circular_game.cpp │ │ └── min_stack.cpp │ ├── Week 4-2 │ │ ├── Baseball-game.cpp │ │ ├── Crawler-log-folder.cpp │ │ ├── Problem_link.txt │ │ ├── Remove-all-adjacent-duplicates-in-string.cpp │ │ └── Time-needed-to-buy-tickets.cpp │ ├── Week 5-1 Special Session │ │ ├── 0_index.txt │ │ ├── recur.cpp │ │ └── special_session.cpp │ ├── Week 5-1 │ │ └── 0_doc_link.txt │ ├── Week 5-2 Recap 2 │ │ ├── add_two_numbers.cpp │ │ ├── doubly_linked_list.cpp │ │ ├── doubly_linked_list.exe │ │ ├── linked_list_cycle.cpp │ │ ├── stl_list.cpp │ │ └── stl_list.exe │ ├── Week 5-2 │ │ ├── deepest_leaves_sum.cpp │ │ ├── print_outer_right.cpp │ │ ├── print_outer_right.exe │ │ ├── sum_of_leafs.cpp │ │ └── sum_of_leafs.exe │ ├── Week 6-1 │ │ ├── 0_index.txt │ │ ├── 1_main.cpp │ │ ├── 2_heapsort.cpp │ │ ├── 3_heapSortWithExtarnalFunction.cpp │ │ └── 4_heapSort_With_Internal_Function.cpp │ └── Week 6-2 │ │ ├── SOS.cpp │ │ ├── mapx.cpp │ │ ├── pair_pq.cpp │ │ ├── priority_queue.cpp │ │ ├── reg_system.cpp │ │ ├── setx.cpp │ │ ├── top_k_elements_leetcode.cpp │ │ └── topics.txt ├── Database │ ├── Week 2-1 │ │ └── subquery.sql │ └── Week 3-1 │ │ ├── ERD.png │ │ └── week-3-1-session.sql ├── Python │ └── Week 1-1 │ │ └── session.py └── SDP │ ├── Week 1-2 │ ├── Images │ │ ├── 4.jpg │ │ ├── 74.jpg │ │ ├── 78.jpg │ │ ├── 85.jpg │ │ ├── Beef Tenderloin.jpg │ │ ├── Grilled Salmon.jpg │ │ ├── Vegetarian Risotto.jpg │ │ ├── asadphoto-1449775.jpg │ │ ├── fotios-photos-776538.jpg │ │ ├── igor-starkov-233202-1055058.jpg │ │ ├── pixabay-260922.jpg │ │ ├── reneterp-2544829.jpg │ │ └── wb2008-2290070.jpg │ ├── index.html │ └── styles.css │ └── week 2-2 │ ├── images │ └── ph_logo.svg │ ├── index.html │ └── script.js ├── Batch 6 ├── Algorithm │ ├── Special Live Class 1 │ │ ├── Commandos.cpp │ │ ├── Guilty_Prince.cpp │ │ └── problems.txt │ ├── Special Live Class 2 │ │ ├── 0_topics.txt │ │ └── labyrinth.cpp │ ├── Week 1-1 │ │ ├── 0_index.txt │ │ ├── 1_matrixToList.cpp │ │ ├── 2_ListTomatrix.cpp │ │ ├── M-1 Variation-of-Graph.pdf │ │ └── M-2 Representation-of-Graph.pdf │ ├── Week 1-2 │ │ ├── 0_topics.txt │ │ ├── counting_countries.cpp │ │ ├── jawa_jabe_kina.cpp │ │ └── max_city_size.cpp │ ├── Week 2-1 │ │ ├── 0_index.txt │ │ ├── 1_maxFish.cpp │ │ └── 2_Counting_Rooms.cpp │ ├── Week 2-2 │ │ ├── 0_topic.txt │ │ ├── Nakanj.cpp │ │ ├── path_manipulation.cpp │ │ └── path_printing2D.cpp │ ├── Week 3-1 │ │ ├── 0_index.txt │ │ ├── bellmanFord.cpp │ │ ├── floydWarshall.cpp │ │ └── networkDelayTime.cpp │ ├── Week 3-2 │ │ ├── 0_topics.txt │ │ ├── Building_road.cpp │ │ ├── road_construction.cpp │ │ └── shobai_connected.cpp │ ├── Week 4-1 │ │ ├── 0_index.txt │ │ ├── 1_1toN.cpp │ │ ├── 2_Nto1.cpp │ │ ├── 3_reachValue.cpp │ │ ├── 4_tribonacci_TopDown.cpp │ │ └── 5_tribonacci_BottomUp.cpp │ └── Week 4-2 │ │ ├── CanReach.txt │ │ ├── TreasureHunt.txt │ │ ├── can_reach.cpp │ │ ├── can_reach_tabulation.cpp │ │ ├── treasure_top_down.cpp │ │ └── tresure_bottom_up.cpp ├── C++ │ ├── 0_topic.txt │ ├── Week 2 C-1 │ │ ├── 0_topics.txt │ │ ├── good_or_bad.cpp │ │ ├── modifier.cpp │ │ ├── replace_word.cpp │ │ ├── string.cpp │ │ ├── string_find.cpp │ │ ├── string_important_functions.cpp │ │ ├── stringstream.cpp │ │ └── useful_function.cpp │ ├── Week-1 C-1 │ │ ├── 0_topic.txt │ │ ├── array_in_function.cpp │ │ ├── dynamic_allocation_of_array.cpp │ │ ├── dynamic_array.cpp │ │ ├── dynamic_variable.cpp │ │ ├── pointer.cpp │ │ └── pointer_of_array.cpp │ └── array_in_function.cpp ├── C │ ├── 4-1 │ │ ├── 2D_array.c │ │ ├── 2D_array.exe │ │ ├── frequency_letter.c │ │ ├── frequency_letter.exe │ │ ├── input.txt │ │ ├── output.txt │ │ ├── value_with_max_occurance.c │ │ └── value_with_max_occurance.exe │ ├── Week 2-1 │ │ ├── lucky_number.c │ │ ├── maximum.c │ │ ├── password.c │ │ ├── phitron_special.c │ │ └── topic.txt │ ├── Week 2-2 │ │ ├── positions_in_array.c │ │ ├── problems.txt.txt │ │ ├── searching.c │ │ ├── shape2.c │ │ └── shape3.c │ ├── Week 4-1 │ │ ├── 0-Topics.txt │ │ ├── deletion_string.c │ │ ├── dig_sum.c │ │ ├── insertion_string.c │ │ ├── palindrome.c │ │ └── reversing.c │ ├── Week 5-1 │ │ ├── 0-Topics.txt │ │ ├── add.c │ │ ├── basic_recursion.c │ │ ├── calling_function.c │ │ ├── function.c │ │ ├── max_array..c │ │ ├── max_min.c │ │ └── prime.c │ └── Week-1 C-1 │ │ ├── 0_topic.txt │ │ ├── array_in_function.cpp │ │ ├── dynamic_allocation_of_array.cpp │ │ ├── dynamic_array.cpp │ │ ├── dynamic_variable.cpp │ │ ├── pointer.cpp │ │ └── pointer_of_array.cpp ├── Data Structure │ ├── Week 1 C-2 │ │ ├── binary_search.cpp │ │ ├── equilibrium_index.cpp │ │ ├── find_first.cpp │ │ ├── input.txt │ │ ├── output.txt │ │ ├── prefix.cpp │ │ └── tst.cpp │ ├── Week 1-1 │ │ ├── 0_topics.txt │ │ ├── divisors.cpp │ │ ├── prime.cpp │ │ ├── sereja_dima.cpp │ │ └── time_complexity.cpp │ ├── Week 2 C-1 │ │ ├── 0_topics.txt │ │ ├── Practice.cpp │ │ ├── head_creation.cpp │ │ ├── insert_at_any_position.cpp │ │ ├── insert_at_tail.cpp │ │ ├── linked_list_node.cpp │ │ ├── middle_element.cpp │ │ ├── printing_linked_list.cpp │ │ ├── reference_of_pointer.cpp │ │ └── size_of_a_linked_list.cpp │ ├── Week 2 C-2 │ │ ├── deleteOperations.cpp │ │ ├── input.txt │ │ ├── isPalindrome.cpp │ │ ├── linklist_desc.cpp │ │ ├── output.txt │ │ └── selectionSort.cpp │ ├── Week 3 C-1 │ │ ├── 0_topics.txt │ │ ├── Website_Visit_problem.cpp │ │ ├── basic.cpp │ │ ├── doubly_linked_list_basic.cpp │ │ ├── doubly_linked_list_insertion.cpp │ │ └── user_input.cpp │ ├── Week 3 C-2 │ │ ├── input.txt │ │ ├── list.cpp │ │ ├── output.txt │ │ ├── remove_list.cpp │ │ └── tst.cpp │ ├── Week 4 C-1 │ │ ├── 0_index.txt │ │ ├── circularGame.cpp │ │ └── minStack.cpp │ ├── Week 4 C-2 │ │ ├── 0_topics.txt │ │ ├── color_problem.cpp │ │ ├── color_problem.exe │ │ └── stack_using_singly.cpp │ ├── Week 4_Special Live Class 1 │ │ ├── input.txt │ │ ├── output.txt │ │ ├── swap_nodes_in_pairs.cpp │ │ └── tst.cpp │ ├── Week 4_Special Live Class 2 │ │ └── Design_linked_list.cpp │ ├── Week 5 C-1 │ │ └── 0_index.txt │ ├── Week 5 C-2 │ │ ├── 0_topics.txt │ │ ├── 1_sum_of_leafNodes.cpp │ │ ├── deepest_leaves_sum.cpp │ │ └── right_outter_nodes.cpp │ ├── Week 6 C-1 │ │ ├── 0_index.txt │ │ └── main.cpp │ ├── Week 6 C-2 │ │ ├── Highest_marks_boss.cpp │ │ ├── map.cpp │ │ ├── pair.cpp │ │ ├── pair_pq.cpp │ │ ├── pr_queue.cpp │ │ ├── reg.cpp │ │ ├── second_order.cpp │ │ ├── set.cpp │ │ └── topics.txt │ ├── Week 6-3 Assignment 4 Special Live Class │ │ ├── Leaf_Nodes.cpp │ │ ├── Level_Nodes.cpp │ │ ├── Perfect_Binary_Tree.cpp │ │ ├── Print_Outer_Tree.cpp │ │ └── Sum_Without_Leaf.cpp │ └── Week 6-4 Final Exam Special Live Class │ │ ├── map.cpp │ │ ├── priority_queue.cpp │ │ ├── priority_queue_class.cpp │ │ ├── priority_queue_pair.cpp │ │ └── set.cpp ├── Database │ ├── Week-2_Session-1 │ │ └── query.txt │ └── Week-3_Session-1 │ │ └── query.txt ├── OOP │ ├── Week 2-1 │ │ ├── abstraction_n_polymorphism.py │ │ ├── class_n_object.py │ │ ├── encapsulation.py │ │ ├── inheritance.py │ │ └── multiple_inheritance.py │ ├── Week 3-1 │ │ └── Online_Food_Order.py │ ├── Week-2 Session-2 │ │ └── PhitronLibrary │ │ │ └── library.py │ └── Week-3 Session-2 │ │ └── Banking-System │ │ ├── bank.py │ │ └── replica.py └── SDP │ ├── Week 1-2 │ ├── Images │ │ ├── 4.jpg │ │ ├── 74.jpg │ │ ├── 78.jpg │ │ ├── 85.jpg │ │ ├── Beef Tenderloin.jpg │ │ ├── Grilled Salmon.jpg │ │ ├── Vegetarian Risotto.jpg │ │ ├── asadphoto-1449775.jpg │ │ ├── fotios-photos-776538.jpg │ │ ├── igor-starkov-233202-1055058.jpg │ │ ├── pixabay-260922.jpg │ │ ├── reneterp-2544829.jpg │ │ └── wb2008-2290070.jpg │ ├── index.html │ └── styles.css │ ├── Week 2-2 │ ├── app.js │ ├── index.html │ └── style.css │ ├── Week-1-1 │ └── youtube-clone-html-css │ │ ├── .vscode │ │ └── settings.json │ │ ├── data │ │ ├── images │ │ │ ├── ph-ask.avif │ │ │ ├── ph-support.avif │ │ │ ├── phitron.jpg │ │ │ └── python.jpg │ │ ├── index.html │ │ ├── others.txt │ │ └── styles.css │ │ ├── images │ │ ├── ph-ask.avif │ │ ├── ph-support.avif │ │ ├── phitron.jpg │ │ └── python.jpg │ │ ├── index.html │ │ ├── others.txt │ │ └── styles.css │ └── Week-2-1 │ └── PH-Clone │ ├── APIData.js │ ├── images │ ├── cover.png │ ├── logo.jpeg │ └── logo.png │ ├── index.html │ ├── script.js │ └── style.css ├── Batch 7 ├── C++ │ ├── Week 1-1 │ │ ├── 0_topics.txt │ │ ├── array_from_function.cpp │ │ ├── dynamic_memory_allocation.cpp │ │ ├── pointer.cpp │ │ └── pointer_in_array.cpp │ ├── Week 1-2 │ │ ├── Dhoni_Kohli.cpp │ │ ├── Practice_Problem_1.cpp │ │ ├── Practice_problem_1_Advance.cpp │ │ ├── four_index_sum_target_value.cpp │ │ ├── sort_function.cpp │ │ ├── string_sort.cpp │ │ └── topics.txt │ ├── Week 2-1 │ │ ├── 0_input.txt │ │ ├── find.cpp │ │ ├── good_or_bad.cpp │ │ ├── line_input.cpp │ │ ├── modification.cpp │ │ ├── replace_word.cpp │ │ ├── reverse_and_sort.cpp │ │ ├── string.cpp │ │ ├── string_functions.cpp │ │ └── stringstream.cpp │ └── Week 2-2 │ │ ├── Practice_problem_1_Advance.cpp │ │ ├── priority_wise_sort.cpp │ │ ├── replace_specific_word.cpp │ │ ├── static_dynamic_array.cpp │ │ ├── swap_particular_member.cpp │ │ ├── topics.txt │ │ └── total_mark_sort.cpp └── C │ ├── Special Session - Assignment 1 │ ├── 0_topics.txt │ ├── data_type.c │ ├── phitron_special.c │ ├── print_four_thirteen.c │ ├── printing.c │ ├── printing_range.c │ └── simple_calc.c │ ├── Special Session - Assignment 2 │ ├── 1_N.c │ ├── N_1.c │ ├── array_reverse.c │ ├── pos_neg_N.c │ ├── pos_neg_sum.c │ ├── problem1.c │ ├── topics.txt │ └── update_indes_value.c │ ├── Week 1-2 │ ├── 0_topics.txt │ ├── divisors.c │ ├── factorial.c │ ├── for_loop.c │ ├── odd_sum.c │ └── problem_1.c │ ├── Week 2-1 │ ├── 0_topics.txt │ ├── Lucky.c │ ├── Pattern-2.c │ └── ambitious.c │ ├── Week 2-2 │ ├── E_lowest_number.c │ ├── even_index.c │ ├── modify_array_index.c │ ├── print_n.c │ ├── searching.c │ ├── sum_pos_neg.c │ └── topics.txt │ ├── Week 3-1 │ ├── 0_topics.txt │ ├── palindrome_array.c │ ├── palindrome_string.c │ ├── printing_pair.c │ ├── reverse.c │ ├── reverse_two.c │ └── strings.c │ ├── Week 3-2 │ ├── Count_letters.c │ ├── I_Love_String.c │ ├── digits_count.c │ ├── programmer.c │ ├── topics.txt │ └── vowels.c │ ├── Week 4-1 │ ├── 0_topics.txt │ ├── pattern.c │ ├── pattern_alphabet.c │ ├── type_1.c │ ├── type_2.c │ ├── type_3.c │ └── type_4.c │ ├── Week 4-2 │ ├── Max_Min.c │ ├── cap_small_digit.c │ ├── count_letters.c │ ├── count_odd.c │ ├── frequency_array.c │ ├── pos_neg_zero.c │ ├── sort_numbers.c │ ├── swap.c │ └── topics.txt │ ├── Week 5-1 │ ├── 0_topic.txt │ ├── basic_recursion.c │ ├── function.c │ ├── print_from_1_to_N.c │ ├── print_from_N_to_1.c │ └── print_recursion.c │ └── Week 5-2 │ ├── A_Beautiful_Matrix.c │ ├── K_Max_Number.c │ ├── L_Summation.c │ ├── first_row_col.c │ ├── mul_bet_two_arr.c │ └── topics.txt └── Batch-4 ├── Django ├── Week 1-1 │ ├── icon │ │ ├── 0.png │ │ ├── 1.png │ │ └── 2.png │ ├── images │ │ ├── background.png │ │ ├── banner.png │ │ ├── product-1.jpg │ │ ├── product-2.jpg │ │ ├── product-3.jpg │ │ └── section.png │ ├── index.html │ ├── logo │ │ ├── logo-dark.png │ │ └── logo-light.png │ └── styles.css ├── Week 4-2 │ └── mealProject │ │ ├── accounts │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── accounts │ │ │ │ ├── login.html │ │ │ │ └── register.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── mealProject │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── meals │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_food_image.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ ├── core │ │ │ │ └── base.html │ │ │ └── meals │ │ │ │ ├── index.html │ │ │ │ └── meal_add.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ └── media │ │ └── meals │ │ └── images │ │ ├── default.png │ │ ├── images.jpeg │ │ └── images_ssnzoBp.jpeg ├── Week 6-1 │ └── mealProject │ │ ├── accounts │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── accounts │ │ │ │ ├── login.html │ │ │ │ └── register.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── mealProject │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── meals │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_food_image.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ ├── core │ │ │ │ └── base.html │ │ │ └── meals │ │ │ │ ├── index.html │ │ │ │ └── meal_add.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ └── media │ │ └── meals │ │ └── images │ │ ├── Chicken-Fried-Rice-square-FS-.jpg │ │ ├── default.png │ │ ├── images.jpeg │ │ └── images_ssnzoBp.jpeg └── Week-8 │ ├── backend │ ├── .gitignore │ ├── Others │ │ └── commands.txt │ ├── README.md │ ├── accounts │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_remove_customuser_name_customuser_user_type.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── tests.py │ │ └── views.py │ ├── db.sqlite3 │ ├── django_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── manage.py │ └── posts │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── permissions.py │ │ ├── serializers.py │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ └── frontend │ ├── addPost.html │ ├── auth.js │ ├── index.html │ ├── login.html │ ├── navbar.html │ ├── navbar.js │ ├── post.js │ ├── post_detail.html │ ├── post_detail.js │ └── registration.html └── OOP ├── Week 2-1 ├── abstraction.py ├── class_n_object.py ├── encapsulation.py ├── multilevel_inheritance.py └── multiple_inheritance.py ├── Week 2-2 └── 0_index.txt └── Week 3-2 └── media_player.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.exe 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Batch-4/Django/Week 2-2"] 2 | path = Batch-4/Django/Week 2-2 3 | url = https://github.com/phitronio/B4-Django-Week-2-ConceptualSession-2.git 4 | -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 04 Special Recap Session/topics.txt: -------------------------------------------------------------------------------- 1 | Problem Solving 2 | 3 | 1. https://cses.fi/problemset/task/1675/ 4 | 5 | Additional 6 | 7 | 1. Minimum road lagbe koita ? 8 | 2. Road beshi ase koita ? (homework) 9 | 10 | 11 | 2. Discussion: 12 | -> Visualizing the path using BFS 13 | -> How can we manipulate path choosing in BFS 14 | 15 | -> visualizing the shortest path in 2D matrix 16 | -> Manipulating path choosing in 2D matrix 17 | 18 | 19 | -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 1-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 1) Introduction 2 | 2) Variation of Graph 3 | 3) Representation 4 | 4) Vector of vector and Array of Vector 5 | 5) Array of vector vs vector of vector 6 | 7 | 8 | row dynamic col dynamic 9 | 10 | 11 | Array of vector No Yes 12 | 13 | 14 | 15 | Vector of vector Yes YES 16 | 17 | 18 | 19 | Note: 20 | vector of vector --> vector>arr; 21 | array of vector --> vector> arr[5]; 22 | -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 1-1/M-1 Variation-of-Graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 1-1/M-1 Variation-of-Graph.pdf -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 1-1/M-2 Representation-of-Graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 1-1/M-2 Representation-of-Graph.pdf -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 1-2/0_index.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 1-2/topics.txt: -------------------------------------------------------------------------------- 1 | Given a graph in 2D matrix , Answer the Following Questions. 2 | 3 | 5 5 4 | ..~.. 5 | ..... 6 | ~~~.~ 7 | ...~~ 8 | ...~~ 9 | 10 | Here '.' indicates cities and '~' indicates river. 11 | 12 | 13 | 14 | 1. Counting Countries in the Matrix 15 | -> DFS and BFS 16 | 17 | 2. Determine if we could go from one place to another 18 | 19 | 3. Shortest route from one city to another city 20 | -> Guess which one to use. 21 | 22 | -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 2-1/0_index.txt: -------------------------------------------------------------------------------- 1 | Problem Link: 2 | https://codeforces.com/problemset/problem/20/C 3 | 4 | Sample Input: 5 | 5 6 6 | 1 2 2 7 | 2 5 5 8 | 2 3 4 9 | 1 4 1 10 | 4 3 3 11 | 3 5 1 12 | 13 | -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 2-2/Minimum Knight Moves.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 2-2/Minimum Knight Moves.bin -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 2-2/Shortest_Routes_2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 2-2/Shortest_Routes_2.bin -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/W_Reach_Value.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 5-1/W_Reach_Value.bin -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/W_Reach_Value.cpp: -------------------------------------------------------------------------------- 1 | // Problem link: https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/W 2 | 3 | #include 4 | using namespace std; 5 | typedef long long int ll; 6 | ll input; 7 | 8 | bool rec(ll n) 9 | { 10 | if(n > input) 11 | return false; 12 | if(n == input) 13 | return true; 14 | return rec(n*10) || rec(n*20); 15 | } 16 | 17 | int main() 18 | { 19 | int t; 20 | cin >> t; 21 | while(t--) 22 | { 23 | cin >> input; 24 | bool flag = rec(1); 25 | if(flag) 26 | cout << "YES\n"; 27 | else 28 | cout << "NO\n"; 29 | } 30 | } -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/climbing_stairs.cpp: -------------------------------------------------------------------------------- 1 | // Problem link: https://leetcode.com/problems/climbing-stairs/description/ 2 | class Solution { 3 | public: 4 | int dp[50]; 5 | int fibo(int n) 6 | { 7 | if(n<=2) 8 | return n; 9 | if(dp[n] != -1) 10 | return dp[n]; 11 | return dp[n] = fibo(n-1) + fibo(n-2); 12 | } 13 | int climbStairs(int n) { 14 | memset(dp, -1, sizeof(dp)); 15 | return fibo(n); 16 | } 17 | }; -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/fibo.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 5-1/fibo.bin -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/fibo_bottom-up.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Algorithm/Week 5-1/fibo_bottom-up.bin -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/fibo_bottom-up.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | int n; 6 | cin >> n; 7 | int dp[n+5]; 8 | dp[0] = 0; 9 | dp[1] = 1; 10 | 11 | for(int i=2;i<=n;i++) 12 | { 13 | dp[i] = dp[i-1] + dp[i-2]; 14 | } 15 | cout << dp[n] << endl; 16 | 17 | } -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/fibo_top-down.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int dp[100005]; 4 | int fibo(int n) 5 | { 6 | if(n<2) 7 | return n; 8 | if(dp[n] != -1) 9 | return dp[n]; 10 | return dp[n] = fibo(n-1) + fibo(n-2); 11 | } 12 | 13 | int main() 14 | { 15 | memset(dp, -1, sizeof(dp)); 16 | int n; 17 | cin >> n; 18 | cout << fibo(n) << endl; 19 | } -------------------------------------------------------------------------------- /Batch 5/Algorithm/Week 5-1/house_robber.cpp: -------------------------------------------------------------------------------- 1 | // Problem link: https://leetcode.com/problems/house-robber/ 2 | class Solution { 3 | public: 4 | int dp[105]; 5 | int rec(int n, vector& nums) 6 | { 7 | if(n<0) 8 | return 0; 9 | if(dp[n] != -1) 10 | return dp[n]; 11 | int op1 = nums[n] + rec(n-2,nums); 12 | int op2 = rec(n-1,nums); 13 | return dp[n] = max(op1, op2); 14 | } 15 | int rob(vector& nums) 16 | { 17 | memset(dp, -1, sizeof(dp)); 18 | int n = nums.size(); 19 | return rec(n-1, nums); 20 | } 21 | }; -------------------------------------------------------------------------------- /Batch 5/C++/C++ 2-2/Find_Ratul.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | string s; 6 | getline(cin,s); 7 | 8 | string word; 9 | stringstream ss(s); 10 | int flag = 0; 11 | while(ss >> word) 12 | { 13 | if(word == "Ratul") 14 | { 15 | flag = 1; 16 | } 17 | } 18 | if(flag==1) 19 | cout << "YES\n"; 20 | else 21 | cout << "NO\n"; 22 | } -------------------------------------------------------------------------------- /Batch 5/C++/C++ 2-2/Find_Ratul.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C++/C++ 2-2/Find_Ratul.exe -------------------------------------------------------------------------------- /Batch 5/C++/C++ 2-2/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 101 Sakib 78 86 90 3 | 102 Rakib 26 19 33 4 | 103 Akib 67 45 88 5 | 104 Asif 56 78 69 6 | 105 Rafi 78 88 94 7 | 106 Shagor 92 56 66 8 | 107 Arif 39 59 60 9 | 108 Mamun 86 89 79 10 | 109 Hasib 55 78 85 11 | 110 Shanto 44 89 54 -------------------------------------------------------------------------------- /Batch 5/C++/C++ 2-2/project.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C++/C++ 2-2/project.exe -------------------------------------------------------------------------------- /Batch 5/C++/C++ 2-2/project_test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C++/C++ 2-2/project_test.exe -------------------------------------------------------------------------------- /Batch 5/C++/C++ 2-2/reverse_object.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C++/C++ 2-2/reverse_object.exe -------------------------------------------------------------------------------- /Batch 5/C++/Week 1-1/1_Introduction.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Topics: 4 | 1)Pointer 5 | 2)Dynamic memory allocation 6 | 7 | Important Link: 8 | visuaizer: https://pythontutor.com/visualize.html#mode=edit 9 | 10 | 11 | Pointer: 12 | 1)What is pointer? 13 | 2)How to use? 14 | 3)What is Dereferencing 15 | 4)Example 16 | 5)Hack 17 | 18 | 19 | Dynamic Memory Allocation: 20 | 1)How to declear for variable and array? 21 | 2)How to take input and show output? 22 | 3)Array increase size. 23 | 4)Return array and variable for funciton. 24 | 5)Actual use of Dynamic memory allocation 25 | 26 | 27 | 28 | 29 | */ 30 | -------------------------------------------------------------------------------- /Batch 5/C++/Week 1-1/3_hack.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | 5 | const int a = 5; 6 | int* b = &a; 7 | 8 | *b = 0; 9 | printf("%d",a); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /Batch 5/C++/Week 1-1/6_return_array_from_funciton.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | using namespace std; 4 | 5 | int** fn(){ 6 | int* b = new int[2]; 7 | b[0] = 5; 8 | b[1] = 10; 9 | return &b; 10 | } 11 | 12 | int main() 13 | { 14 | int** a = fn(); 15 | cout< 2 | using namespace std; 3 | int main(){ 4 | int a = 3; 5 | 6 | int *p1 = &a; 7 | 8 | cout<<&a< 12 | using namespace std; 13 | 14 | int main(){ 15 | string s; 16 | getline(cin,s); 17 | 18 | stringstream ss(s); 19 | string word; 20 | ss>>word; 21 | reverse(word.begin(),word.end()); 22 | cout<>word){ 25 | reverse(word.begin(),word.end()); 26 | cout<<" "< 12 | using namespace std; 13 | 14 | int main(){ 15 | string str = "ProgrammingPhitronHero"; 16 | 17 | str.replace(str.find("Phitron"),7," "); 18 | cout< 23 | using namespace std; 24 | int main() 25 | { 26 | string s; 27 | getline(cin,s); 28 | 29 | stringstream ss; 30 | 31 | ss<>word;cnt++){ 36 | 37 | } 38 | 39 | cout< 12 | using namespace std; 13 | 14 | int main(){ 15 | string str = "Programming Hero "; 16 | 17 | int cnt = 0; 18 | while(str.find("Phitron")!=-1){ 19 | str.replace(str.find("Phitron"),7," "); 20 | cnt++; 21 | } 22 | cout< 2 | int main(){ 3 | // for(int i=0;i<26;i++){ 4 | // printf("%d->%c\n",i,i+97); 5 | // } 6 | 7 | // char ch = getchar(); 8 | // printf("%d",ch-97); 9 | 10 | char ch; 11 | int fq[26] = {0}; 12 | 13 | while(scanf("%c",&ch)!=EOF){ 14 | int index = ch - 97; 15 | fq[index]+=1; 16 | } 17 | 18 | for(int i=0;i<26;i++){ 19 | if(fq[i]>0){ 20 | printf("%c : %d\n",i+97,fq[i]); 21 | } 22 | } 23 | 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-1/1_index.txt: -------------------------------------------------------------------------------- 1 | Discussion Topic: 2 | 1- Introduction 3 | 2- What are the 4 types of functions in C? 4 | What are the different categories of functions in C Programming? 5 | -Functions without arguments and without return values. 6 | -Functions without arguments and with return values. 7 | -Functions with arguments and without return values. 8 | -Functions with arguments and with return values. 9 | 10 | i)Return + Arguments 11 | ii)No Return + Arguments 12 | iii)Return +No Arguments 13 | iv)No Return + Arguments 14 | 15 | 3- Problem Solving 16 | 17 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-1/3_Return_Argumnt.c: -------------------------------------------------------------------------------- 1 | /** 2 | You are given a positive integer n. 3 | Now print the sum of last digit and first digit of the given integers. 4 | Implement it using function. 5 | Note – It is guaranteed that all the integers will be a 4 digit value 6 | 7 | Sample Input: 8 | 1234 9 | Sample Output: 10 | Sum = 5 11 | 12 | 13 | */ 14 | #include 15 | 16 | int extract_sum(int n) 17 | { 18 | int firstNum = n / 1000; 19 | int lastNum = n % 10; 20 | return firstNum + lastNum; 21 | } 22 | int main() 23 | { 24 | int num; 25 | scanf("%d", &num); 26 | int result = extract_sum(num); 27 | printf("%d",result); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-1/5_Return_No_Argumnt.c: -------------------------------------------------------------------------------- 1 | /*** 2 | * Example : Phi value 3 | * 4 | */ 5 | 6 | 7 | #include 8 | 9 | float getPHI(void){ 10 | return 3.1416; 11 | } 12 | 13 | 14 | int main() 15 | { 16 | float PI = getPHI(); 17 | printf("%f",PI); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-1/6_No_Return_No_Argumnt.c: -------------------------------------------------------------------------------- 1 | /** 2 | Write a C program to take one positive integer N as input and print all even numbers 3 | from 2 to N. 4 | Implement it using function. 5 | 6 | 7 | Sample Input 1: 8 | 10 9 | Sample Output 1: 10 | 2 4 6 8 10 11 | 12 | Sample Input 2: 13 | 7 14 | Sample Output 2: 15 | 2 4 6 16 | */ 17 | 18 | #include 19 | void solve(){ 20 | int n; 21 | scanf("%d",&n); 22 | for(int i=2;i<=n;i++){ 23 | if(i%2==0){ 24 | printf("%d ",i); 25 | } 26 | } 27 | } 28 | 29 | #include 30 | int main(){ 31 | solve(); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-1/7_Problem_Solving.c: -------------------------------------------------------------------------------- 1 | /** 2 | * https://codeforces.com/problemset/problem/1709/A 3 | */ 4 | 5 | #include 6 | void solve(){ 7 | int key; 8 | scanf("%d",&key); 9 | int arr[5]; 10 | 11 | for(int i=1;i<=3;i++){ 12 | scanf("%d",&arr[i]); 13 | } 14 | 15 | if(arr[key]==0){ 16 | printf("NO\n"); 17 | return; 18 | } 19 | key = arr[key]; 20 | 21 | if(arr[key]==0){ 22 | printf("NO\n"); 23 | return; 24 | } 25 | printf("YES\n"); 26 | } 27 | 28 | int main(){ 29 | int test; 30 | scanf("%d",&test); 31 | while(test--){ 32 | solve(); 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-1/doc_link.txt: -------------------------------------------------------------------------------- 1 | https://docs.google.com/document/d/1m3HSxsvkjhL9PIqAx3I40VJhUx0xtw84chsVAAMYvRo/edit?usp=sharing 2 | -------------------------------------------------------------------------------- /Batch 5/C/Week 4-2: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Batch 5/C/Week 5-1/0 DocLink.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://docs.google.com/document/d/1FarVJERlB_flqPb0lJCwWQvRYIT9CErujL9y3mSwg5o/edit 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Batch 5/C/Week 5-1/A_Print_Recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void solve(int n){ 5 | if(n==0) return; 6 | printf("I love Recursion\n"); 7 | solve(n--); 8 | } 9 | 10 | int main(){ 11 | int n; 12 | scanf("%d",&n); 13 | solve(n); 14 | 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /Batch 5/C/Week 5-1/B_Print_from_1_to_N.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int solve(int n){ 4 | if(n==0) return 1; 5 | int result = n + solve(n-1); 6 | return result; 7 | } 8 | 9 | 10 | int main(){ 11 | int n; 12 | scanf("%d",&n); 13 | int result = solve(n); 14 | printf("%d",result); 15 | 16 | 17 | return 100; 18 | } 19 | -------------------------------------------------------------------------------- /Batch 5/C/Week 5-1/C_Print_from_N_to_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void solve(int n){ 4 | if(n==0) return; 5 | if(n==1) 6 | printf("%d",n); 7 | else 8 | printf("%d ",n); 9 | solve(n-1); 10 | } 11 | 12 | 13 | int main(){ 14 | int n; 15 | scanf("%d",&n); 16 | solve(n); 17 | 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Batch 5/C/Week 5-1/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main(){ 3 | int x = 10; 4 | printf("%d ",x++); 5 | // printf("%d",++x); 6 | 7 | return 0; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/2d_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int marks[100][5]; 5 | 6 | return 0; 7 | } -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/A_Beautiful_Matrix.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C/Week 5-2/A_Beautiful_Matrix.bin -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/A_Beautiful_Matrix.c: -------------------------------------------------------------------------------- 1 | // Problem link: https://codeforces.com/problemset/problem/263/A 2 | 3 | #include 4 | #include 5 | int main() 6 | { 7 | int a[5][5]; 8 | for(int i=0;i<5;i++) 9 | { 10 | for(int j=0;j<5;j++) 11 | { 12 | scanf("%d",&a[i][j]); 13 | } 14 | } 15 | 16 | int ans; 17 | for(int i=0;i<5;i++) 18 | { 19 | for(int j=0;j<5;j++) 20 | { 21 | if(a[i][j]==1) 22 | { 23 | ans = abs(i-2) + abs(j-2); 24 | } 25 | } 26 | } 27 | 28 | printf("%d\n",ans); 29 | return 0; 30 | } -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/F_Fox_And_Snake.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C/Week 5-2/F_Fox_And_Snake.bin -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/first_row_first_col.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C/Week 5-2/first_row_first_col.bin -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/first_row_first_col.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int t; 5 | scanf("%d", &t); 6 | while(t--) 7 | { 8 | 9 | int r, c; 10 | scanf("%d %d", &r, &c); 11 | int a[r][c]; 12 | 13 | for (int i = 0; i < r; i++) 14 | { 15 | for (int j = 0; j < c; j++) 16 | { 17 | scanf("%d", &a[i][j]); 18 | } 19 | } 20 | 21 | for (int i = 0; i < c; i++) 22 | { 23 | printf("%d ", a[0][i]); 24 | } 25 | printf("\n"); 26 | 27 | for (int i = 0; i < r; i++) 28 | { 29 | printf("%d ", a[i][0]); 30 | } 31 | printf("\n"); 32 | } 33 | return 0; 34 | } -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/first_row_first_col.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C/Week 5-2/first_row_first_col.exe -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/rahim_vs_karim.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/C/Week 5-2/rahim_vs_karim.bin -------------------------------------------------------------------------------- /Batch 5/C/Week 5-2/rahim_vs_karim.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d",&n); 6 | char s[n+1]; 7 | scanf("%s",s); 8 | 9 | int r=0,k=0; 10 | for(int i=0;ik) 22 | { 23 | printf("Rahim\n"); 24 | } 25 | else if(r 2 | using namespace std; 3 | int main() 4 | { 5 | int n; 6 | cin >> n; 7 | vector v (n); 8 | 9 | for(int i=0;i> v[i]; 12 | } 13 | 14 | for(int i=0;i 2 | using namespace std; 3 | int main() 4 | { 5 | int n; 6 | cin >> n; 7 | int a[n]; 8 | for(int i=0;i> a[i]; 11 | } 12 | 13 | 14 | int pre[n]; 15 | pre[0] = a[0]; 16 | 17 | for(int i=1;i 2 | using namespace std; 3 | int main() 4 | { 5 | vector v = {10,20,30,40,50}; 6 | 7 | v.erase(v.begin()+1, v.begin()+4); 8 | 9 | for(int i=0;i 2 | using namespace std; 3 | int main() 4 | { 5 | vector v = {10,20,30,40,50}; 6 | vector v2 = {100,200,300,400,500}; 7 | 8 | v.insert(v.begin(), v2.begin()+1, v2.end()-1); 9 | for(int i=0;i 2 | using namespace std; 3 | 4 | 5 | class Node{ 6 | public: 7 | int val; 8 | Node* next; 9 | }; 10 | 11 | int main(){ 12 | Node x,y; 13 | 14 | x.val = 10; 15 | y.val = 20; 16 | 17 | x.next = &y; 18 | y.next = NULL; 19 | 20 | 21 | cout< 2 | using namespace std; 3 | 4 | 5 | class Node{ 6 | public: 7 | int val; 8 | Node* next; 9 | 10 | Node(int val){ 11 | this->val = val; 12 | this->next = NULL; 13 | } 14 | }; 15 | 16 | int main(){ 17 | Node x(10),y(20); 18 | 19 | // x.val = 10; 20 | // y.val = 20; 21 | 22 | x.next = &y; 23 | y.next = NULL; 24 | 25 | 26 | cout< 2 | using namespace std; 3 | 4 | 5 | class Node{ 6 | public: 7 | int val; 8 | Node* next; 9 | }; 10 | 11 | int main(){ 12 | // int* a = new int; 13 | Node* x = new Node; 14 | Node* y = new Node; 15 | 16 | x->val = 10; 17 | y->val = 20; 18 | 19 | x->next = y; 20 | y->next = NULL; 21 | 22 | 23 | 24 | cout<val<<" "<val< 2 | using namespace std; 3 | 4 | 5 | class Node{ 6 | public: 7 | int val; 8 | Node* next; 9 | 10 | Node(int val){ 11 | this->val = val; 12 | this->next = NULL; 13 | } 14 | }; 15 | 16 | int main(){ 17 | // int* a = new int; 18 | Node* x = new Node(10); 19 | Node* y = new Node(20); 20 | 21 | // x->val = 10; 22 | // y->val = 20; 23 | 24 | x->next = y; 25 | y->next = NULL; 26 | 27 | 28 | 29 | cout<val<<" "<val<next; 11 | } 12 | return cnt; 13 | } 14 | int getDecimalValue(ListNode* head) { 15 | int sz = size(head); 16 | int x = pow(2,sz-1); 17 | int ans = 0; 18 | for(ListNode* temp = head; temp!=NULL; temp=temp->next) 19 | { 20 | if(temp->val == 1) 21 | { 22 | ans+=x; 23 | } 24 | x/=2; 25 | } 26 | return ans; 27 | } 28 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 3-2/Intersection-of-two-linked-lists.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { 4 | 5 | for(ListNode* tempA=headA; tempA!=NULL; tempA = tempA->next) 6 | { 7 | for(ListNode* tempB=headB; tempB!=NULL; tempB = tempB->next) 8 | { 9 | if(tempA == tempB) 10 | return tempA; 11 | } 12 | } 13 | return NULL; 14 | } 15 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 3-2/Merge-in-between-linked-lists.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) { 4 | ListNode* temp = list1; 5 | for(int i=1;inext; 8 | } 9 | cout << temp->val << endl; 10 | 11 | ListNode* temp2 = temp->next; 12 | for(int i=a;i<=b;i++) 13 | { 14 | temp2 = temp2->next; 15 | } 16 | cout << temp2->val << endl; 17 | 18 | temp->next = list2; 19 | 20 | ListNode* temp3 = list2; 21 | while(temp3->next != NULL) 22 | { 23 | temp3 = temp3->next; 24 | } 25 | 26 | temp3->next = temp2; 27 | return list1; 28 | } 29 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 3-2/Swap-nodes-in-pairs.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | ListNode* swapPairs(ListNode* head) { 4 | if(head == NULL || head->next == NULL) 5 | return head; 6 | 7 | ListNode* temp1 = head; 8 | ListNode* temp2 = head->next; 9 | 10 | while(temp1!=NULL && temp2!=NULL) 11 | { 12 | swap(temp1->val, temp2->val); 13 | temp1 = temp1->next->next; 14 | if(temp1==NULL) 15 | break; 16 | temp2 = temp2->next->next; // temp2 = NULL 17 | } 18 | 19 | return head; 20 | } 21 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 3-2/gcd.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | ListNode* insertGreatestCommonDivisors(ListNode* head) { 4 | ListNode* temp = head; 5 | while(temp->next!=NULL) 6 | { 7 | int gcd = __gcd(temp->val, temp->next->val); 8 | ListNode* newnode = new ListNode(gcd); 9 | newnode->next = temp->next; 10 | temp->next = newnode; 11 | 12 | temp = temp->next->next; 13 | } 14 | return head; 15 | } 16 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 4-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 1) Min Stack: https://leetcode.com/problems/min-stack/description/ 2 | 2) Backsapce: https://leetcode.com/problems/backspace-string-compare/ 3 | 3) Circular Game: https://leetcode.com/problems/find-the-winner-of-the-circular-game/ -------------------------------------------------------------------------------- /Batch 5/DS/Week 4-1/backsapce.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | stackss,tt; 4 | bool backspaceCompare(string s, string t) { 5 | 6 | for(int i=0;iq; 4 | int findTheWinner(int n, int k) { 5 | for(int i=1;i<=n;i++){ 6 | q.push(i); 7 | } 8 | 9 | int cnt = 0; 10 | 11 | while(q.size()>1){ 12 | int v = q.front(); 13 | q.pop(); 14 | cnt++; 15 | if(cnt==k) cnt = 0; 16 | else q.push(v); 17 | } 18 | 19 | return q.front(); 20 | 21 | } 22 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 4-2/Crawler-log-folder.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minOperations(vector& logs) { 4 | stack st; 5 | 6 | for(string s : logs) 7 | { 8 | if(s=="../") 9 | { 10 | if(!st.empty()) 11 | st.pop(); 12 | } 13 | else if(s=="./") 14 | continue; 15 | else 16 | st.push(s); 17 | } 18 | return st.size(); 19 | } 20 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 4-2/Problem_link.txt: -------------------------------------------------------------------------------- 1 | https://docs.google.com/document/d/1pdrRILQ58wqTgZOeAPvMXU6RU3f5L4UedKuUmzuI-WA/edit?usp=sharing -------------------------------------------------------------------------------- /Batch 5/DS/Week 4-2/Remove-all-adjacent-duplicates-in-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string removeDuplicates(string s) { 4 | stack st; 5 | for(char c : s) 6 | { 7 | if(!st.empty() && c==st.top()) 8 | st.pop(); 9 | else 10 | st.push(c); 11 | } 12 | 13 | string ans = ""; 14 | while(!st.empty()) 15 | { 16 | ans += st.top(); 17 | st.pop(); 18 | } 19 | reverse(ans.begin(), ans.end()); 20 | return ans; 21 | } 22 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 4-2/Time-needed-to-buy-tickets.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int timeRequiredToBuy(vector& tickets, int k) { 4 | queue q; 5 | int time = 0; 6 | 7 | int n = tickets.size(); 8 | for(int i=0;i 7 | #define ll long long int 8 | #define ull unsigned long long int 9 | #define nl '\n' 10 | using namespace std; 11 | 12 | void fun(int val){ 13 | if(val==6) return; 14 | fun(val+1); 15 | cout<next != NULL) 10 | { 11 | slow = slow->next; 12 | fast = fast->next->next; 13 | if(slow == fast) 14 | return true; 15 | } 16 | return false; 17 | } 18 | }; -------------------------------------------------------------------------------- /Batch 5/DS/Week 5-2 Recap 2/stl_list.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | list l = {10,20,30,40,40,40,50}; 6 | l.remove(10); 7 | for(int val : l) 8 | cout << val << endl; 9 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 5-2 Recap 2/stl_list.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/DS/Week 5-2 Recap 2/stl_list.exe -------------------------------------------------------------------------------- /Batch 5/DS/Week 5-2/print_outer_right.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/DS/Week 5-2/print_outer_right.exe -------------------------------------------------------------------------------- /Batch 5/DS/Week 5-2/sum_of_leafs.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/DS/Week 5-2/sum_of_leafs.exe -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 1) Intro 2 | 2) What is Complete Binary tree? 3 | 3) Array representaiton of Complete Binary tree. 4 | 4) Insertion 5 | 5) Deletion 6 | 6) Array to Heap Convertion 7 | 7) Heap Sort 8 | 8) Problem Link: https://leetcode.com/problems/sort-an-array/ -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/SOS.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | set val; 8 | 9 | int n; 10 | cin >> n; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | int x; 15 | cin >> x; 16 | val.insert(x); 17 | } 18 | auto it = val.begin(); 19 | it++; 20 | 21 | if (it != val.end()) 22 | { 23 | cout << *it << endl; 24 | } 25 | else 26 | cout << "NO" << endl; 27 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/mapx.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | map identity; // ( key, value) 8 | // 1st 9 | identity["Rahim"] = 18; 10 | identity["Karim"] = 20; 11 | // 2nd 12 | 13 | identity.insert(make_pair("Aziz", 22)); 14 | 15 | // 3rd 16 | identity.insert({"Nayeem", 28}); 17 | identity["Nayeem"] = 30; 18 | 19 | for (auto pair : identity) 20 | { 21 | cout << pair.first << " " << pair.second << endl; 22 | } 23 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/pair_pq.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class cmp 5 | { 6 | public: 7 | bool operator()(pair &a, pair &b) 8 | { 9 | 10 | if (a.second < b.second) 11 | return true; 12 | else 13 | return false; 14 | } 15 | }; 16 | 17 | int main() 18 | { 19 | 20 | priority_queue, vector>, cmp> pq; // max heap 21 | 22 | pq.push({1, 3}); 23 | pq.push({2, 1}); 24 | pq.push({4, 0}); 25 | 26 | while (!pq.empty()) 27 | { 28 | 29 | cout << pq.top().first << " " << pq.top().second << endl; 30 | pq.pop(); 31 | } 32 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/priority_queue.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | priority_queue pq; // max heap 8 | 9 | pq.push(10); 10 | pq.push(40); 11 | pq.push(30); 12 | 13 | // while (!pq.empty()) 14 | // { 15 | // cout << pq.top() << endl; 16 | // pq.pop(); 17 | // } 18 | 19 | priority_queue, greater> minheap; 20 | 21 | minheap.push(10); 22 | minheap.push(40); 23 | minheap.push(30); 24 | 25 | while (!minheap.empty()) 26 | { 27 | cout << minheap.top() << endl; 28 | minheap.pop(); 29 | } 30 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/reg_system.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | map count; 8 | 9 | int n; 10 | cin >> n; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | string name; 15 | cin >> name; 16 | 17 | if (count[name] == 0) 18 | cout << "OK" << endl; 19 | else 20 | cout << name << count[name] << endl; 21 | 22 | count[name] = count[name] + 1; 23 | } 24 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/setx.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | set s; 8 | 9 | s.insert(40); 10 | s.insert(30); 11 | s.insert(10); 12 | s.insert(20); 13 | s.insert(10); 14 | 15 | for (auto it : s) 16 | { 17 | cout << it << endl; 18 | } 19 | } -------------------------------------------------------------------------------- /Batch 5/DS/Week 6-2/topics.txt: -------------------------------------------------------------------------------- 1 | Pair (prerequisites) 2 | 1. Map 3 | https://codeforces.com/problemset/problem/4/C 4 | 2. Set 5 | https://codeforces.com/problemset/problem/22/A 6 | 7 | 8 | Quiz : 9 | 10 | 1. Priority Queue 11 | -Max PQ 12 | -Min PQ 13 | 2. Custom Comparator for Priority Queue 14 | ->https://leetcode.com/problems/top-k-frequent-elements/description/ 15 | -------------------------------------------------------------------------------- /Batch 5/Database/Week 3-1/ERD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/Database/Week 3-1/ERD.png -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/4.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/74.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/74.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/78.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/78.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/85.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/85.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/Beef Tenderloin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/Beef Tenderloin.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/Grilled Salmon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/Grilled Salmon.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/Vegetarian Risotto.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/Vegetarian Risotto.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/asadphoto-1449775.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/asadphoto-1449775.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/fotios-photos-776538.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/fotios-photos-776538.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/igor-starkov-233202-1055058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/igor-starkov-233202-1055058.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/pixabay-260922.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/pixabay-260922.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/reneterp-2544829.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/reneterp-2544829.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/Images/wb2008-2290070.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 5/SDP/Week 1-2/Images/wb2008-2290070.jpg -------------------------------------------------------------------------------- /Batch 5/SDP/Week 1-2/styles.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | color: rgb(131, 131, 131) 3 | 4 | } 5 | 6 | /* Hero section */ 7 | .hero{ 8 | background: url('./Images/pixabay-260922.jpg'); 9 | background-size: cover; 10 | height: 100vh; 11 | } 12 | 13 | .header, .details { 14 | color:white 15 | } 16 | 17 | /* Menu section */ 18 | .menu-card{ 19 | transition: all 0.3s ease-in-out; 20 | } 21 | .menu-card:hover{ 22 | transform: scale(1.05); 23 | } 24 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Special Live Class 1/problems.txt: -------------------------------------------------------------------------------- 1 | https://lightoj.com/problem/guilty-prince [DFS] 2 | https://lightoj.com/problem/commandos [BFS] 3 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Special Live Class 2/0_topics.txt: -------------------------------------------------------------------------------- 1 | Problem Solving 2 | 3 | 1. Labyrinth (CSES) -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 1-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 2 | 1) Introduction 3 | 2) Variant 4 | 3) Adjacency Matrix to Adjacency List 5 | 4) Adjacency List to Adjacency Matrix -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 1-1/M-1 Variation-of-Graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/Algorithm/Week 1-1/M-1 Variation-of-Graph.pdf -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 1-1/M-2 Representation-of-Graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/Algorithm/Week 1-1/M-2 Representation-of-Graph.pdf -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 1-2/0_topics.txt: -------------------------------------------------------------------------------- 1 | Given a graph in 2D matrix , Answer the Following Questions. 2 | 3 | 5 8 4 | ~~~~~~~~ 5 | ~..~...~ 6 | ~~~~.~.~ 7 | ~..~...~ 8 | ~~~~~~~~ 9 | 10 | Here '.' indicates cities and '~' indicates river. 11 | 12 | 1. Counting number of countries in the Matrix 13 | 2. Determine if we could go from one city to another by vehicle 14 | 3. Number of max cities in the MAP -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 2-1/0_index.txt: -------------------------------------------------------------------------------- 1 | Problem Link: 2 | 1) Maximum Number of fish: https://leetcode.com/problems/maximum-number-of-fish-in-a-grid/description/ 3 | 2) Counting Rooms: https://cses.fi/problemset/submit/1192/ 4 | 3) https://www.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1?utm_source=geeksforgeeks&utm_medium=article_practice_tab&utm_campaign=article_practice_tab -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 2-2/0_topic.txt: -------------------------------------------------------------------------------- 1 | 1. A problem based on Graph Algorithm 2 | https://www.spoj.com/problems/NAKANJ/ 3 | 4 | 5 | 2. Shortest Path printing of Graph 6 | + How can we manipulate the path 7 | 8 | 3. Shortest Path Printing of 2D graph 9 | 10 | 5 5 11 | Aoooo 12 | .###o 13 | .###o 14 | .###o 15 | ....B 16 | 17 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 3-1/0_index.txt: -------------------------------------------------------------------------------- 1 | Bellman Ford: https://www.geeksforgeeks.org/problems/distance-from-the-source-bellman-ford-algorithm/1 2 | Floyd Warshall: https://www.geeksforgeeks.org/problems/implementing-floyd-warshall2042/1 3 | Network Delay Time: https://leetcode.com/problems/network-delay-time/description/ [using Floyd Warshall] 4 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 3-2/0_topics.txt: -------------------------------------------------------------------------------- 1 | Problem Solving 2 | 3 | 1. Road Construction : https://cses.fi/problemset/task/1676 4 | 2. Building Roads https://cses.fi/problemset/task/1666/ 5 | 6 | 7 | Additional : 8 | Let's say for a graph we have connected the nodes with edges. How to determine if all the node got connected or not ? -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 4-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 1) Introduction to Recursion 2 | 2) Print 1 to n using Recursion 3 | 3) Print n to 1 using Recursion 4 | 4) Reach Value: https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/W 5 | 4) Introduction to Dynamic Programming 6 | 5) Tribonacci: https://leetcode.com/problems/n-th-tribonacci-number/description/ -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 4-1/1_1toN.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * All Praise to Allah 3 | * --------------------- 4 | * Author: Asif Mohammed Sifat 5 | * Created: 2025-03-03 21:33:47 6 | * Source: 7 | */ 8 | #include 9 | using namespace std; 10 | 11 | void fun(int n){ 12 | // base case 13 | if(n==4) return; 14 | // task 15 | cout< 9 | using namespace std; 10 | 11 | void fun(int n){ 12 | // base case 13 | if(n==4) return; 14 | 15 | // recursive call 16 | fun(n+1); 17 | 18 | 19 | // task 20 | cout< 9 | using namespace std; 10 | 11 | long long int input; 12 | 13 | bool fun(long long int n) 14 | { 15 | if(n>input) return false; 16 | 17 | if(n==input) return true; 18 | 19 | bool t1 = fun(n*10); 20 | bool t2 = fun(n*20); 21 | 22 | return t1 || t2; 23 | 24 | } 25 | 26 | int main() 27 | { 28 | int t; 29 | cin>>t; 30 | 31 | while(t--){ 32 | cin>>input; 33 | if(fun(1)) cout<<"YES\n"; 34 | else cout<<"NO\n"; 35 | } 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 4-1/4_tribonacci_TopDown.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int dp[50]; 4 | 5 | Solution() { 6 | memset(dp, -1, sizeof(dp)); 7 | } 8 | 9 | int tribonacci(int n) { 10 | if(n == 0) return 0; 11 | if(n == 1 || n == 2) return 1; 12 | 13 | if(dp[n] != -1) return dp[n]; 14 | 15 | dp[n] = tribonacci(n - 1) + tribonacci(n - 2) + tribonacci(n - 3); 16 | return dp[n]; 17 | } 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 4-1/5_tribonacci_BottomUp.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int tribonacci(int n) { 4 | vector dp(50); 5 | dp[0] = 0; 6 | dp[1] = 1; 7 | dp[2] = 1; 8 | 9 | for (int i = 3; i <= n; i++) { 10 | dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]; 11 | } 12 | 13 | return dp[n]; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /Batch 6/Algorithm/Week 4-2/CanReach.txt: -------------------------------------------------------------------------------- 1 | Input Format: 2 | First line will contain T, the number of test cases. 3 | In each test case you will be given N. 4 | 5 | You will be given a positive integer N. You will start from 1 and do some steps (possibly zero). 6 | 7 | In each step you can choose one of the following: 8 | 1. Add 5 with the current value 9 | 2. Multiply by 4 with the current value 10 | Can you tell if you can reach N by using any number of steps you want. 11 | 12 | Constraints 13 | 1<=T<=10^3 14 | 1<=N<=10^5 15 | 16 | Output Format: 17 | Print "YES" if you can reach , "NO" otherwise. 18 | 19 | Sample Input 0 20 | 6 21 | 1 22 | 3 23 | 6 24 | 15 25 | 16 26 | 64 27 | 28 | Sample Output 0 29 | YES 30 | NO 31 | YES 32 | NO 33 | YES 34 | YES -------------------------------------------------------------------------------- /Batch 6/C++/0_topic.txt: -------------------------------------------------------------------------------- 1 | Topic: 2 | 3 | Pointers Recap 4 | 1. Pointer Definition 5 | 2. Dereferencing / Accessing the value 6 | 3. Pointer of an Array 7 | 8 | 9 | 10 | Dynamic Memory Allocation: 11 | 12 | 1. Stack memory and Heap memory 13 | 2. Dynamic Variable allocation with visualization 14 | -> declaration 15 | -> input 16 | ->output 17 | 3. Dynamic array allocation with visualization 18 | -> declaration 19 | -> input 20 | -> output 21 | 22 | 4. Why we need Dynamic Array ? 23 | -> memory allocation / deallocation 24 | -> function 25 | 26 | 5. Array in a function 27 | 28 | Visualizer: https://pythontutor.com/render.html#mode=edit 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/good_or_bad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | int t; 7 | cin >> t; 8 | 9 | while (t--) 10 | { 11 | 12 | string s; 13 | cin >> s; 14 | 15 | if (s.find("010") != -1 || s.find("101") != -1) 16 | { 17 | cout << "Good" << endl; 18 | } 19 | else 20 | { 21 | cout << "Bad" << endl; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/modifier.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // string s = "hello"; 8 | // string s1 = "hi"; 9 | 10 | // s = s1; // strcpy 11 | 12 | string s; 13 | cin >> s; 14 | 15 | // string s1 = "hello"; 16 | // s = s + 'n'; 17 | 18 | s.pop_back(); // delete the last char 19 | 20 | cout << s << endl; 21 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/replace_word.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; 8 | cin >> s; 9 | 10 | while (1) 11 | { 12 | int pos = s.find("EGYPT"); 13 | 14 | if (pos != -1) 15 | { 16 | 17 | s.erase(pos, 5); 18 | s.insert(s.begin() + pos, ' '); 19 | } 20 | else 21 | { 22 | break; 23 | } 24 | } 25 | 26 | cout << s << endl; 27 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/string.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; // dynamically 8 | cin >> s; 9 | 10 | for (auto it = s.begin(); it != s.end(); it++) 11 | { 12 | cout << *it << endl; 13 | } 14 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/string_find.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | string s = "hellooworld"; 7 | 8 | // find 9 | 10 | // pawa gele oi word tar prothom index dibe 11 | // pawa na gele -1 return korbe 12 | 13 | int pawa_gese = s.find("phitron"); 14 | 15 | cout << pawa_gese << endl; 16 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/string_important_functions.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // erase 8 | 9 | string s = "HelloinWorld"; 10 | // s.erase(5, 2); 11 | // cout << s << endl; 12 | 13 | // // after insertion 14 | 15 | // s.insert(5, "the"); 16 | 17 | // cout << s << endl; 18 | 19 | // replace 20 | 21 | s.replace(5, 2, " "); 22 | 23 | cout << s << endl; 24 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/stringstream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; 8 | 9 | getline(cin, s); 10 | 11 | stringstream ss(s); 12 | 13 | string word; 14 | 15 | while (ss >> word) 16 | { 17 | cout << word << endl; 18 | } 19 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week 2 C-1/useful_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; 8 | cin >> s; 9 | 10 | // reverse(s.begin(), s.end()); 11 | 12 | sort(s.begin(), s.end()); 13 | 14 | cout << s << endl; 15 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/0_topic.txt: -------------------------------------------------------------------------------- 1 | Topic: 2 | 3 | Pointers Recap 4 | 1. Pointer Definition 5 | 2. Dereferencing / Accessing the value 6 | 3. Pointer of an Array 7 | 8 | 9 | 10 | Dynamic Memory Allocation: 11 | 12 | 1. Stack memory and Heap memory 13 | 2. Dynamic Variable allocation with visualization 14 | -> declaration 15 | -> input 16 | ->output 17 | 3. Dynamic array allocation with visualization 18 | -> declaration 19 | -> input 20 | -> output 21 | 22 | 4. Why we need Dynamic Array ? 23 | -> memory allocation / deallocation 24 | -> function 25 | 26 | 5. Array in a function 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/array_in_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // create an array in a function 5 | // initialize its values 6 | // return the array to the main function 7 | // print the array 8 | 9 | int *func() 10 | { 11 | int ar[5]; 12 | 13 | for (int i = 0; i < 5; i++) 14 | { 15 | ar[i] = i + 1; 16 | } 17 | 18 | return ar; 19 | } 20 | 21 | int main() 22 | { 23 | 24 | int *arr = func(); 25 | 26 | for (int i = 0; i < 5; i++) 27 | { 28 | cout << arr[i] << endl; 29 | } 30 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/dynamic_allocation_of_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int *ar = new int[3]; 8 | ar[0] = 10; 9 | ar[1] = 20; 10 | ar[2] = 30; 11 | 12 | int ar1[5]; 13 | 14 | for (int i = 0; i < 3; i++) 15 | { 16 | ar1[i] = ar[i]; 17 | } 18 | 19 | delete[] ar; 20 | ar1[3] = 12; 21 | ar1[4] = 13; 22 | 23 | for (int i = 0; i < 5; i++) 24 | { 25 | cout << ar1[i] << endl; 26 | } 27 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/dynamic_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int *arr = new int[3]; 8 | 9 | for (int i = 0; i < 3; i++) 10 | { 11 | cin >> arr[i]; 12 | } 13 | 14 | for (int i = 0; i < 3; i++) 15 | { 16 | cout << arr[i] << endl; 17 | } 18 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/dynamic_variable.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int *a = new int; 8 | 9 | cin >> *a; 10 | 11 | cout << *a << endl; 12 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/pointer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int a = 10; 8 | 9 | cout << &a << endl; // a er address print korbe 10 | 11 | int *a_ptr = &a; // ekhane a er address ta k rakhlam 12 | 13 | cout << a_ptr << endl; // a er address ta print korbe 14 | 15 | cout << "before deferencing" << endl; 16 | 17 | cout << a << endl; 18 | 19 | *a_ptr = 15; 20 | 21 | cout << "after deferencing" << endl; 22 | 23 | cout << a << endl; 24 | 25 | cout << *a_ptr << endl; 26 | 27 | // a ar *a_ptr same jinish 28 | } -------------------------------------------------------------------------------- /Batch 6/C++/Week-1 C-1/pointer_of_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int arr[5]; 8 | 9 | *(arr) = 10; // *(arr+0) => arr[0] 10 | *(arr + 1) = 20; // *(arr+1) => arr[1] ; 11 | *(arr + 2) = 30; // *(arr+2) => arr[2] ; 12 | 13 | *(arr + 3) = 40; 14 | 15 | *(arr + 4) = 50; 16 | 17 | for (int i = 0; i < 5; i++) 18 | { 19 | cout << *(arr + i) << endl; 20 | } 21 | } -------------------------------------------------------------------------------- /Batch 6/C++/array_in_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // create an array in a function 5 | // initialize its values 6 | // return the array to the main function 7 | // print the array 8 | 9 | int *func() 10 | { 11 | int *ar = new int[5]; 12 | 13 | for (int i = 0; i < 5; i++) 14 | { 15 | ar[i] = i + 1; 16 | } 17 | 18 | return ar; 19 | } 20 | 21 | int main() 22 | { 23 | 24 | int *main_arr = func(); 25 | 26 | for (int i = 0; i < 5; i++) 27 | { 28 | cout << main_arr[i] << endl; 29 | } 30 | } -------------------------------------------------------------------------------- /Batch 6/C/4-1/2D_array.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/C/4-1/2D_array.exe -------------------------------------------------------------------------------- /Batch 6/C/4-1/frequency_letter.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d",&n); 6 | char s[n+5]; 7 | scanf("%s",s); 8 | 9 | int freq[26] = {0}; 10 | for(int i=0;i 2 | int main() 3 | { 4 | int n; 5 | scanf("%d",&n); 6 | int a[n]; 7 | for(int i=0;i mx) 24 | { 25 | mx = freq[i]; 26 | val = i; 27 | } 28 | } 29 | printf("%d -> %d",val,mx); 30 | return 0; 31 | } -------------------------------------------------------------------------------- /Batch 6/C/4-1/value_with_max_occurance.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/C/4-1/value_with_max_occurance.exe -------------------------------------------------------------------------------- /Batch 6/C/Week 2-1/lucky_number.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | int second_digit = n % 10; 10 | int first_digit = n / 10; 11 | 12 | if (second_digit == 0) 13 | { 14 | 15 | // corner case 16 | 17 | printf("YES\n"); 18 | } 19 | 20 | else if (first_digit % second_digit == 0 || second_digit % first_digit == 0) 21 | { 22 | printf("YES\n"); 23 | } 24 | else 25 | { 26 | printf("NO\n"); 27 | } 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 2-1/maximum.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int n; 7 | scanf("%d", &n); 8 | 9 | int maximum_value = INT_MIN; 10 | printf("%d\n", maximum_value); 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | int x; 15 | scanf("%d", &x); 16 | 17 | if (maximum_value < x) 18 | { 19 | maximum_value = x; 20 | } 21 | } 22 | 23 | printf("%d\n", maximum_value); 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 2-1/password.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | 8 | while (scanf("%d", &n) != EOF) 9 | { 10 | if (n == 1999) 11 | { 12 | printf("Correct\n"); 13 | break; 14 | } 15 | else 16 | { 17 | printf("Wrong\n"); 18 | } 19 | } 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 2-1/topic.txt: -------------------------------------------------------------------------------- 1 | If else related problem: 2 | -> Phitron Holiday Special 3 | 4 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/326175/problem/I 5 | -> corner case , if else revision 6 | 7 | Loop Related Problems: 8 | 9 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/D 10 | 2. https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/E -------------------------------------------------------------------------------- /Batch 6/C/Week 2-2/positions_in_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | int a[n]; 7 | for (int i = 0; i < n; i++) 8 | scanf("%d", &a[i]); 9 | for (int i = 0; i < n; i++) 10 | { 11 | if (a[i] <= 10) 12 | { 13 | printf("A[%d] = %d\n", i, a[i]); 14 | } 15 | } 16 | return 0; 17 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 2-2/problems.txt.txt: -------------------------------------------------------------------------------- 1 | Here are the problems we have solved in today's class: 2 | 3 | Pattern Related: 4 | 1.https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/T 5 | 2.https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/W 6 | 7 | Array Related: 8 | 1.https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/B 9 | 2.https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/D -------------------------------------------------------------------------------- /Batch 6/C/Week 2-2/searching.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | int a[n]; 7 | for (int i = 0; i < n; i++) 8 | { 9 | scanf("%d", &a[i]); 10 | } 11 | int x; 12 | scanf("%d", &x); 13 | 14 | int search = -1; 15 | for (int i = 0; i < n; i++) 16 | { 17 | if (a[i] == x) 18 | { 19 | search = i; 20 | break; 21 | } 22 | } 23 | printf("%d", search); 24 | return 0; 25 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 2-2/shape3.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | int space = n - 1; 7 | int star = 1; 8 | for (int i = 1; i <= 2*n; i++) 9 | { 10 | for (int j = 1; j <= space; j++) 11 | printf(" "); 12 | for (int j = 1; j <= star; j++) 13 | printf("*"); 14 | printf("\n"); 15 | if(i < n) 16 | { 17 | space--; 18 | star += 2; 19 | } 20 | else if(i > n) 21 | { 22 | space++; 23 | star -= 2; 24 | } 25 | } 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 4-1/0-Topics.txt: -------------------------------------------------------------------------------- 1 | Week 4 Conceptual Session 1 2 | 3 | Topics: 4 | 5 | 1. Intro to String 6 | Operations: 7 | i. Insertion 8 | ii. Deletion 9 | 10 | 2. Reversing an Array / String 11 | -> Naive 12 | -> Two Pointers Approach 13 | 14 | Problem: https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/F 15 | 16 | 17 | Problem Solving 18 | 19 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/G (Palindrome Array) 20 | -> Naive way (Extra Array) 21 | -> Two Pointers 22 | 23 | 2. https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/K 24 | -> Long Number 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Batch 6/C/Week 4-1/deletion_string.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | char word[8]; 7 | 8 | scanf("%s", word); 9 | 10 | for (int i = 3; i <= 6; i++) 11 | { 12 | word[i] = word[i + 1]; 13 | } 14 | 15 | printf("%s", word); 16 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 4-1/dig_sum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | char num[n + 1]; 10 | 11 | scanf("%s", num); 12 | 13 | long long int sum = 0; 14 | 15 | for (int i = 0; i < n; i++) 16 | { 17 | int dig = num[i] - '0'; // ascii er maan ta delete kore 18 | sum = sum + dig; 19 | } 20 | 21 | printf("%d", sum); 22 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 4-1/insertion_string.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | char word[8]; 7 | 8 | scanf("%s", word); 9 | 10 | for (int i = 6; i >= 2; i--) 11 | { 12 | word[i + 1] = word[i]; 13 | } 14 | 15 | word[2] = 'c'; 16 | 17 | printf("%s", word); 18 | } 19 | 20 | // 2 number index e c insert korte hobe -------------------------------------------------------------------------------- /Batch 6/C/Week 4-1/palindrome.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | int a[n]; 10 | 11 | for (int i = 0; i < n; i++) 12 | { 13 | scanf("%d", &a[i]); 14 | } 15 | 16 | int l = 0, r = n - 1; 17 | 18 | int pal = 1; 19 | 20 | while (l <= r) 21 | { 22 | 23 | if (a[l] != a[r]) 24 | { 25 | pal = 0; 26 | break; 27 | } 28 | 29 | l++; // l k shamner dike niye gesi 30 | r--; // r k pechoner dike niye ashchi 31 | } 32 | 33 | if (pal == 1) 34 | { 35 | printf("YES\n"); 36 | } 37 | else 38 | { 39 | printf("NO\n"); 40 | } 41 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 4-1/reversing.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | int a[n]; 10 | 11 | for (int i = 0; i < n; i++) 12 | { 13 | scanf("%d", &a[i]); 14 | } 15 | 16 | int l = 0, r = n - 1; 17 | 18 | while (l <= r) 19 | { 20 | // swapping 21 | int tmp = a[l]; 22 | a[l] = a[r]; 23 | a[r] = tmp; 24 | 25 | l++; // l k shamner dike niye gesi 26 | r--; // r k pechoner dike niye ashchi 27 | } 28 | 29 | for (int i = 0; i < n; i++) 30 | { 31 | printf("%d ", a[i]); 32 | } 33 | printf("\n"); 34 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/0-Topics.txt: -------------------------------------------------------------------------------- 1 | Topic: 2 | 3 | Function : ( Definition ) 4 | 1. Parameter + Return 5 | 2. No Parameter + Return 6 | 3. Parameter + NO Return 7 | 4. No Parameter + No return 8 | 9 | Problem solving : 10 | 1. Add (works with every type) () 11 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/G (parameter , no return ) 12 | 2. https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/G (no parameter , no return) 13 | 14 | additional : 15 | 1. Call by value 16 | 2. Call by reference 17 | (when to use ) 18 | 19 | 20 | Recursion: 21 | 1. Defination 22 | 3. how to think recursively 23 | 24 | Problem : 25 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/K 26 | -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/add.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // parameter , return 4 | int add1(int a, int b) 5 | { 6 | int sum = a + b; 7 | 8 | return sum; 9 | } 10 | 11 | // no parameter (function input nibe), return ( main receive) 12 | int add2() 13 | { 14 | 15 | int a, b; 16 | scanf("%d %d", &a, &b); 17 | int sum = a + b; 18 | 19 | return sum; 20 | } 21 | 22 | // no return , no parameter 23 | void add3() 24 | { 25 | 26 | int a, b; 27 | scanf("%d %d", &a, &b); 28 | int sum = a + b; 29 | 30 | printf("%d\n", sum); 31 | } 32 | 33 | int main() 34 | { 35 | 36 | add3(); 37 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/basic_recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void print_hello_n_times(int n) 4 | { 5 | 6 | if (n == 0) 7 | { 8 | return; 9 | } 10 | 11 | printf("Hello\n"); // ami ekbar print korlam 12 | 13 | print_hello_n_times(n - 1); // bhai baki tmi 4 bar print koro 14 | } 15 | 16 | int main() 17 | { 18 | 19 | print_hello_n_times(5); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/calling_function.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void change_to_10(int *x) 4 | { 5 | 6 | *x = 10; 7 | } 8 | 9 | int main() 10 | { 11 | 12 | int n = 100; 13 | 14 | // printf("%d\n", &n); 15 | 16 | change_to_10(&n); 17 | 18 | printf("%d\n", n); 19 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/function.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void add() 4 | { 5 | int a, b; 6 | scanf("%d %d", &a, &b); 7 | 8 | printf("%d\n", a + b); 9 | } 10 | 11 | int main() 12 | { 13 | add(); 14 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/max_array..c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int a[1001]; 4 | 5 | int max_from_this_index(int index, int n) 6 | { 7 | 8 | if (index == n - 1) 9 | { 10 | return a[index]; 11 | } 12 | 13 | int right_side_maximum = max_from_this_index(index + 1, n); 14 | 15 | if (right_side_maximum > a[index]) 16 | { 17 | return right_side_maximum; 18 | } 19 | else 20 | { 21 | return a[index]; 22 | } 23 | } 24 | 25 | int main() 26 | { 27 | 28 | int n; 29 | scanf("%d", &n); 30 | 31 | for (int i = 0; i < n; i++) 32 | { 33 | scanf("%d", &a[i]); 34 | } 35 | 36 | printf("%d\n", max_from_this_index(0, n)); 37 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/max_min.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // no parameter , no return 4 | void max_min() 5 | { 6 | 7 | int n; 8 | scanf("%d", &n); 9 | 10 | int a[n]; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | scanf("%d", &a[i]); 15 | } 16 | 17 | int minimum = 100001; 18 | 19 | for (int i = 0; i < n; i++) 20 | { 21 | if (minimum > a[i]) 22 | { 23 | minimum = a[i]; 24 | } 25 | } 26 | 27 | int maximum = -1; 28 | 29 | for (int i = 0; i < n; i++) 30 | { 31 | if (maximum < a[i]) 32 | { 33 | maximum = a[i]; 34 | } 35 | } 36 | 37 | printf("%d %d\n", minimum, maximum); 38 | } 39 | 40 | int main() 41 | { 42 | max_min(); 43 | } -------------------------------------------------------------------------------- /Batch 6/C/Week 5-1/prime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void prime_check(int n) 4 | { 5 | 6 | int flag = 1; // dhore nisi prime number 7 | 8 | for (int i = 2; i < n; i++) 9 | { 10 | if (n % i == 0) 11 | { 12 | flag = 0; 13 | break; 14 | } 15 | } 16 | 17 | if (flag == 1) 18 | { 19 | printf("YES\n"); 20 | } 21 | else 22 | { 23 | printf("NO\n"); 24 | } 25 | } 26 | 27 | int main() 28 | { 29 | 30 | int t; 31 | scanf("%d", &t); 32 | 33 | for (int i = 0; i < t; i++) 34 | { 35 | int n; 36 | scanf("%d", &n); 37 | 38 | prime_check(n); 39 | } 40 | } -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/0_topic.txt: -------------------------------------------------------------------------------- 1 | Topic: 2 | 3 | Pointers Recap 4 | 1. Pointer Definition 5 | 2. Dereferencing / Accessing the value 6 | 3. Pointer of an Array 7 | 8 | 9 | 10 | Dynamic Memory Allocation: 11 | 12 | 1. Stack memory and Heap memory 13 | 2. Dynamic Variable allocation with visualization 14 | -> declaration 15 | -> input 16 | ->output 17 | 3. Dynamic array allocation with visualization 18 | -> declaration 19 | -> input 20 | -> output 21 | 22 | 4. Why we need Dynamic Array ? 23 | -> memory allocation / deallocation 24 | -> function 25 | 26 | 5. Array in a function 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/array_in_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // create an array in a function 5 | // initialize its values 6 | // return the array to the main function 7 | // print the array 8 | 9 | int *func() 10 | { 11 | int ar[5]; 12 | 13 | for (int i = 0; i < 5; i++) 14 | { 15 | ar[i] = i + 1; 16 | } 17 | 18 | return ar; 19 | } 20 | 21 | int main() 22 | { 23 | 24 | int *arr = func(); 25 | 26 | for (int i = 0; i < 5; i++) 27 | { 28 | cout << arr[i] << endl; 29 | } 30 | } -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/dynamic_allocation_of_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int *ar = new int[3]; 8 | ar[0] = 10; 9 | ar[1] = 20; 10 | ar[2] = 30; 11 | 12 | int ar1[5]; 13 | 14 | for (int i = 0; i < 3; i++) 15 | { 16 | ar1[i] = ar[i]; 17 | } 18 | 19 | delete[] ar; 20 | ar1[3] = 12; 21 | ar1[4] = 13; 22 | 23 | for (int i = 0; i < 5; i++) 24 | { 25 | cout << ar1[i] << endl; 26 | } 27 | } -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/dynamic_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int *arr = new int[3]; 8 | 9 | for (int i = 0; i < 3; i++) 10 | { 11 | cin >> arr[i]; 12 | } 13 | 14 | for (int i = 0; i < 3; i++) 15 | { 16 | cout << arr[i] << endl; 17 | } 18 | } -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/dynamic_variable.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int *a = new int; 8 | 9 | cin >> *a; 10 | 11 | cout << *a << endl; 12 | } -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/pointer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int a = 10; 8 | 9 | cout << &a << endl; // a er address print korbe 10 | 11 | int *a_ptr = &a; // ekhane a er address ta k rakhlam 12 | 13 | cout << a_ptr << endl; // a er address ta print korbe 14 | 15 | cout << "before deferencing" << endl; 16 | 17 | cout << a << endl; 18 | 19 | *a_ptr = 15; 20 | 21 | cout << "after deferencing" << endl; 22 | 23 | cout << a << endl; 24 | 25 | cout << *a_ptr << endl; 26 | 27 | // a ar *a_ptr same jinish 28 | } -------------------------------------------------------------------------------- /Batch 6/C/Week-1 C-1/pointer_of_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int arr[5]; 8 | 9 | *(arr) = 10; // *(arr+0) => arr[0] 10 | *(arr + 1) = 20; // *(arr+1) => arr[1] ; 11 | *(arr + 2) = 30; // *(arr+2) => arr[2] ; 12 | 13 | *(arr + 3) = 40; 14 | 15 | *(arr + 4) = 50; 16 | 17 | for (int i = 0; i < 5; i++) 18 | { 19 | cout << *(arr + i) << endl; 20 | } 21 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 1 C-2/binary_search.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(){ 5 | int n, target; 6 | 7 | cin >> n; 8 | 9 | vectora(n); 10 | 11 | for(int i=0; i> a[i]; 13 | } 14 | 15 | cin >> target; 16 | 17 | int l=0, r=n-1; 18 | 19 | while(l <= r){ 20 | int mid = (l+r)/2; 21 | 22 | if(a[mid] == target){ 23 | cout << "khuje paici index no: " << mid << endl; 24 | return 0; 25 | } 26 | else if(a[mid] > target){ 27 | r = mid -1; 28 | } 29 | else{ 30 | l = mid + 1; 31 | } 32 | 33 | } 34 | 35 | 36 | cout << "khuje pai ny" << endl; 37 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 1 C-2/equilibrium_index.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(){ 5 | int n; 6 | cin >> n; 7 | 8 | vectora(n); 9 | 10 | int totalSum=0; 11 | 12 | for(int i=0; i> a[i]; 14 | totalSum += a[i]; 15 | } 16 | 17 | vectorpref(n); 18 | 19 | pref[0] = a[0]; 20 | 21 | for(int i=1; i 2 | using namespace std; 3 | 4 | int main(){ 5 | int n; 6 | cin >> n; 7 | 8 | vectora(n); 9 | 10 | for(int i=0; i> a[i]; 12 | } 13 | 14 | vectorpref(n); 15 | 16 | pref[0] = a[0]; 17 | 18 | for(int i=1; i 2 | using namespace std; 3 | void fun(int *&p){ 4 | p = NULL; 5 | } 6 | int main() { 7 | int val = 10; 8 | int *ptr = &val; 9 | fun(ptr); 10 | cout << ptr << endl; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 1-1/0_topics.txt: -------------------------------------------------------------------------------- 1 | Time Complexity: 2 | 3 | 1. What is time complexity 4 | 2. Overview of popular time complexity: 5 | 3. Why we need to calculate time complexity before writing code 6 | 7 | 8 | Problems: 9 | 1 : https://codeforces.com/group/MWSDmqGsZm/contest/223205/problem/D 10 | 11 | Can we do this using this complexities ? 12 | https://docs.google.com/document/d/1i2zJTPCAImx0bPmCijqBeCP5-C_D-VVuJPdI68w-5RA/edit?tab=t.0 13 | 14 | 15 | 16 | 17 | 18 | 19 | Vector: 20 | 1. What is vector 21 | 2. Why vector ? 22 | 23 | 24 | 25 | Problems: 26 | 1. Divisors (https://lightoj.com/problem/dimik-divisor) 27 | 2. Sereja and Dima 28 | https://codeforces.com/group/MWSDmqGsZm/contest/223206/problem/L -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 2 C-1/0_topics.txt: -------------------------------------------------------------------------------- 1 | 1. What is linked list 2 | 2. Why linked list 3 | 3. Dynamic Node 4 | 4. Reference of a pointer 5 | 6. Printing a Singly Linked list 6 | 7. Insertion 7 | -> Head 8 | -> Tail 9 | -> Any position 10 | 11 | 8. Size of a Singly Linked List 12 | 13 | Practice: 14 | 1. Middle elements of a linked list 15 | 2. Checking if a linked list is sorted or not 16 | -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 2 C-1/linked_list_node.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Node 5 | { 6 | public: 7 | int value; 8 | Node *next; 9 | 10 | Node(int value) 11 | { 12 | this->value = value; 13 | this->next = NULL; 14 | } 15 | }; 16 | 17 | int main() 18 | { 19 | 20 | // dynamic Node creation 21 | 22 | Node *head = new Node(10); 23 | Node *a = new Node(20); 24 | Node *b = new Node(30); 25 | 26 | head->next = a; 27 | a->next = b; 28 | 29 | cout << head->next->next->value << endl; 30 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 2 C-1/reference_of_pointer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | void null_converter(int *&p) 5 | { 6 | p = NULL; 7 | } 8 | 9 | int main() 10 | { 11 | 12 | int a; 13 | cin >> a; 14 | 15 | int *p = &a; 16 | 17 | null_converter(p); 18 | 19 | if (p != NULL) 20 | { 21 | cout << *p << endl; 22 | } 23 | else 24 | { 25 | cout << "P is pointed to null" << endl; 26 | } 27 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 2 C-2/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 2 1 -1 -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 2 C-2/output.txt: -------------------------------------------------------------------------------- 1 | Palindrome 2 | -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 2 C-2/selectionSort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | int n; 6 | cin >> n; 7 | int a[n]; 8 | for(int i=0;i> a[i]; 11 | } 12 | 13 | for(int i=0;i Head 8 | -> Tail 9 | -> Any position 10 | 2. Deletion (Homework) 11 | 12 | 13 | 3.Input from user 14 | 15 | 4.Linked List Size in O(1) 16 | 17 | 18 | Problem Solving: 19 | 20 | 1. Browser History 21 | https://leetcode.com/problems/design-browser-history/ 22 | -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 3 C-1/basic.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int sum(int a, int b) 5 | { // implement this function to sum up two numbers 6 | int s = a + b; 7 | return s; 8 | } 9 | 10 | int main() 11 | { 12 | 13 | int a, b; 14 | cin >> a >> b; 15 | cout << sum(a, b); 16 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 3 C-2/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 2 3 4 1 -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 3 C-2/list.cpp: -------------------------------------------------------------------------------- 1 | //check if the list is Palindrome. 2 | #include 3 | using namespace std; 4 | 5 | bool isPalindrome(list&l){ 6 | auto front = l.begin(); 7 | auto back = l.rbegin(); 8 | 9 | for(int i=0; il; 20 | int n; 21 | cin>> n; 22 | for(int i=0; i> val; 25 | l.push_back(val); 26 | } 27 | 28 | if(isPalindrome(l)){ 29 | cout << "Palindrome"< 2 | using namespace std; 3 | 4 | int main(){ 5 | listl = {1, 2 , 3, 6, 4, 6,5}; 6 | 7 | for(int val: l){ 8 | cout << val << " "; 9 | } 10 | cout << endl; 11 | 12 | l.remove(6); 13 | 14 | for(int val: l){ 15 | cout << val << " "; 16 | } 17 | cout << endl; 18 | 19 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 3 C-2/tst.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(){ 5 | 6 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 4 C-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 1) Min Stack: https://leetcode.com/problems/min-stack/description/ 2 | 2) Circular Game: https://leetcode.com/problems/find-the-winner-of-the-circular-game/ -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 4 C-1/circularGame.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findTheWinner(int n, int k) { 4 | queueq; 5 | for(int i=1;i<=n;i++){ 6 | q.push(i); 7 | } 8 | 9 | int cnt = 0; 10 | while(q.size()>1){ 11 | int v = q.front(); 12 | q.pop(); 13 | cnt++; 14 | if(cnt!=k){ 15 | q.push(v); 16 | }else{ 17 | cnt = 0; 18 | } 19 | } 20 | 21 | return q.front(); 22 | 23 | } 24 | }; -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 4 C-1/minStack.cpp: -------------------------------------------------------------------------------- 1 | class MinStack { 2 | public: 3 | stackst,mn; 4 | MinStack() { 5 | 6 | } 7 | 8 | void push(int val) { 9 | 10 | if(mn.empty()){ 11 | st.push(val); 12 | mn.push(val); 13 | return; 14 | } 15 | st.push(val); 16 | int minVal = min(val,mn.top()); 17 | mn.push(minVal); 18 | } 19 | 20 | void pop() { 21 | st.pop(); 22 | mn.pop(); 23 | return; 24 | } 25 | 26 | int top() { 27 | return st.top(); 28 | } 29 | 30 | int getMin() { 31 | return mn.top(); 32 | } 33 | }; -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 4 C-2/color_problem.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/Data Structure/Week 4 C-2/color_problem.exe -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 4_Special Live Class 1/input.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/Data Structure/Week 4_Special Live Class 1/input.txt -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 4_Special Live Class 1/output.txt: -------------------------------------------------------------------------------- 1 | Invalid index 2 | 20 10 30 100 200 3 | tail--->200 4 | -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 5 C-2/0_topics.txt: -------------------------------------------------------------------------------- 1 | Problem Solving 2 | 3 | 1. Sum of Leaf Nodes 4 | 5 | 2. Print Right outter nodes 6 | 7 | 3. Deepest Leaves sum 8 | https://leetcode.com/problems/deepest-leaves-sum/description/ 9 | 10 | -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-1/0_index.txt: -------------------------------------------------------------------------------- 1 | 1) Intro 2 | 2) What is Complete Binary tree? 3 | 3) Array representaiton of Complete Binary tree. 4 | 4) Insertion 5 | 5) Deletion - challenging 6 | 6) Array to Heap Convertion 7 | 7) Heap Sort 8 | 8) Problem Link: https://leetcode.com/problems/sort-an-array/ -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/map.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | map frequency; 8 | 9 | string s; 10 | cin >> s; 11 | 12 | for (int i = 0; i < s.size(); i++) 13 | { 14 | 15 | char cur_char = s[i]; 16 | 17 | frequency[cur_char]++; 18 | } 19 | 20 | int q; 21 | cin >> q; 22 | 23 | while (q--) 24 | { 25 | char ch; 26 | cin >> ch; 27 | 28 | cout << frequency[ch] << endl; 29 | } 30 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/pair.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | vector> student_data; 8 | 9 | for (int i = 0; i < 3; i++) 10 | { 11 | string a; 12 | cin >> a; 13 | int roll; 14 | cin >> roll; 15 | student_data.push_back({a, roll}); 16 | } 17 | 18 | for (int i = 0; i < 3; i++) 19 | { 20 | cout << student_data[i].first << " " << student_data[i].second << endl; 21 | } 22 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/pr_queue.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // priority_queue pq; // max heap ; 8 | 9 | priority_queue, greater> pq; // min heap 10 | 11 | for (int i = 0; i < 5; i++) 12 | { 13 | string s; 14 | cin >> s; 15 | pq.push(s); 16 | } 17 | 18 | while (!pq.empty()) 19 | { 20 | cout << pq.top() << endl; 21 | pq.pop(); 22 | } 23 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/reg.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | map frequency; 8 | 9 | int n; 10 | cin >> n; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | string username; 15 | cin >> username; 16 | 17 | // username ta koibar ase 18 | if (frequency[username] == 0) 19 | { 20 | cout << "OK" << endl; 21 | } 22 | else 23 | { 24 | cout << username << frequency[username] << endl; 25 | } 26 | 27 | frequency[username]++; 28 | } 29 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/second_order.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | set s; 8 | 9 | int n; 10 | cin >> n; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | int x; 15 | cin >> x; 16 | s.insert(x); 17 | } 18 | 19 | if (s.size() <= 1) 20 | { 21 | cout << "NO" << endl; 22 | } 23 | else 24 | { 25 | 26 | auto it = s.begin(); 27 | it++; 28 | 29 | cout << *it << endl; 30 | } 31 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/set.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | set s; 8 | 9 | for (int i = 0; i < 5; i++) 10 | { 11 | int x; 12 | cin >> x; 13 | s.insert(x); 14 | } 15 | 16 | for (auto it : s) 17 | { 18 | cout << it << endl; 19 | } 20 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6 C-2/topics.txt: -------------------------------------------------------------------------------- 1 | 1.Pair (prerequisites) 2 | 3 | 2. Map 4 | https://codeforces.com/problemset/problem/4/C 5 | 3. Set 6 | https://codeforces.com/problemset/problem/22/A 7 | 8 | 9 | 4. Priority Queue 10 | -Max PQ 11 | -Min PQ 12 | Problem . Custom Comparator for Priority Queue 13 | 14 | 1. Roll Name Marks given , 15 | 16 | print highest marks student information 17 | if the marks is same print the name who has lower roll. -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6-4 Final Exam Special Live Class/map.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // map map_name 8 | 9 | map freq; 10 | 11 | string s; 12 | cin >> s; 13 | 14 | int mx_count = -1; 15 | char ans; 16 | 17 | for (int i = 0; i < s.size(); i++) 18 | { 19 | freq[s[i]]++; 20 | 21 | if (mx_count < freq[s[i]]) 22 | { 23 | mx_count = freq[s[i]]; 24 | ans = s[i]; 25 | } 26 | } 27 | 28 | cout << ans << " " << mx_count << endl; 29 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6-4 Final Exam Special Live Class/priority_queue.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // priority_queue name ; 8 | 9 | priority_queue pq; 10 | 11 | priority_queue, greater> min_heap; 12 | 13 | int n; 14 | cin >> n; 15 | 16 | for (int i = 0; i < n; i++) 17 | { 18 | int x; 19 | cin >> x; 20 | // pq.push(x); 21 | min_heap.push(x); 22 | } 23 | 24 | while (!min_heap.empty()) 25 | { 26 | cout << min_heap.top() << endl; 27 | min_heap.pop(); 28 | } 29 | } -------------------------------------------------------------------------------- /Batch 6/Data Structure/Week 6-4 Final Exam Special Live Class/set.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // set < data_type> name ; 8 | 9 | set name; 10 | 11 | int n; 12 | cin >> n; 13 | 14 | // insertion : set_name.insert() ; 15 | 16 | for (int i = 0; i < n; i++) 17 | { 18 | 19 | string s; 20 | cin >> s; 21 | name.insert(s); 22 | } 23 | 24 | for (auto it : name) 25 | { 26 | cout << it << " "; 27 | } 28 | cout << endl; 29 | } -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/4.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/74.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/74.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/78.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/78.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/85.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/85.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/Beef Tenderloin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/Beef Tenderloin.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/Grilled Salmon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/Grilled Salmon.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/Vegetarian Risotto.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/Vegetarian Risotto.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/asadphoto-1449775.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/asadphoto-1449775.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/fotios-photos-776538.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/fotios-photos-776538.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/igor-starkov-233202-1055058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/igor-starkov-233202-1055058.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/pixabay-260922.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/pixabay-260922.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/reneterp-2544829.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/reneterp-2544829.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/Images/wb2008-2290070.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week 1-2/Images/wb2008-2290070.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week 1-2/styles.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler{ 2 | border-color: white!important; 3 | } 4 | 5 | .hero { 6 | background: url('./Images/pixabay-260922.jpg'); 7 | background-size: cover; 8 | height: 100vh; 9 | position: relative; 10 | } 11 | 12 | .hero::before{ 13 | content: ""; 14 | position: absolute; 15 | width: 100%; 16 | height: 100%; 17 | background: rgba(0, 0, 0, 0.489); 18 | } 19 | -------------------------------------------------------------------------------- /Batch 6/SDP/Week 2-2/style.css: -------------------------------------------------------------------------------- 1 | .card-img{ 2 | height: 200px; 3 | object-fit: cover; 4 | } -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "Laliga", 4 | "Phitron", 5 | "stylesheet" 6 | ] 7 | } -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/ph-ask.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/ph-ask.avif -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/ph-support.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/ph-support.avif -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/phitron.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/phitron.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/python.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/images/python.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/data/others.txt: -------------------------------------------------------------------------------- 1 | 2 | youtube logo : https://upload.wikimedia.org/wikipedia/commons/b/b8/YouTube_Logo_2017.svg 3 | 4 | home icon : 5 | microphone icon : 6 | clock icon : -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/ph-ask.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/ph-ask.avif -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/ph-support.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/ph-support.avif -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/phitron.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/phitron.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/python.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-1-1/youtube-clone-html-css/images/python.jpg -------------------------------------------------------------------------------- /Batch 6/SDP/Week-1-1/youtube-clone-html-css/others.txt: -------------------------------------------------------------------------------- 1 | 2 | youtube logo : https://upload.wikimedia.org/wikipedia/commons/b/b8/YouTube_Logo_2017.svg 3 | 4 | home icon : 5 | microphone icon : 6 | clock icon : 7 | search icon : -------------------------------------------------------------------------------- /Batch 6/SDP/Week-2-1/PH-Clone/images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-2-1/PH-Clone/images/cover.png -------------------------------------------------------------------------------- /Batch 6/SDP/Week-2-1/PH-Clone/images/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-2-1/PH-Clone/images/logo.jpeg -------------------------------------------------------------------------------- /Batch 6/SDP/Week-2-1/PH-Clone/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch 6/SDP/Week-2-1/PH-Clone/images/logo.png -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-1/0_topics.txt: -------------------------------------------------------------------------------- 1 | 2 | Pointers Recap 3 | -> Dereferencing 4 | -> Pointers of an array 5 | 6 | 7 | 8 | Dynamic Memory Allocation: 9 | 10 | 1. Stack memory and Heap memory 11 | 2. Dynamic Variable allocation with visualization 12 | -> declaration 13 | -> input 14 | ->output 15 | 3. Dynamic array allocation with visualization 16 | -> declaration 17 | -> input 18 | -> output 19 | 20 | 4. Why we need Dynamic Array ? 21 | -> memory allocation / deallocation 22 | -> function 23 | 24 | 5. Array in a function -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-1/array_from_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int* fun() 5 | { 6 | int*arr = new int[4] ; 7 | 8 | return arr ; 9 | 10 | } 11 | 12 | int main() 13 | { 14 | 15 | int* arr = fun() ; 16 | 17 | 18 | for(int i =0 ;i<4 ;i++){ 19 | cout << arr[i] << endl ; 20 | } 21 | 22 | 23 | 24 | 25 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-1/dynamic_memory_allocation.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | void fun() 5 | { 6 | 7 | int *ptr = new int; 8 | 9 | *ptr = 100; 10 | 11 | cout << *ptr << endl; 12 | } 13 | 14 | int main() 15 | { 16 | 17 | int a = 10; 18 | 19 | cout << a << endl; 20 | 21 | fun(); 22 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-1/pointer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | int a = 10; 8 | 9 | cout << "a er address " << &a << endl; 10 | 11 | int *ptr = &a; 12 | 13 | cout << "pointer e store ase " << ptr << endl; 14 | 15 | // dereferencing 16 | 17 | *ptr = 100; // ptr k dereferencing kora 18 | 19 | cout << a << endl; 20 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-1/pointer_in_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | int arr[4] = {10, 20, 30, 40}; 7 | 8 | // cout << &arr[0] << endl; 9 | 10 | // cout << arr << endl; 11 | 12 | *(arr + 0) = 100; // arr[0] ; 13 | 14 | *(arr + 1) = 200; // arr[1] ; 15 | 16 | for (int i = 0; i < 4; i++) 17 | { 18 | cout << arr[i] << endl; 19 | } 20 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-2/Dhoni_Kohli.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Cricketer 5 | { 6 | public: 7 | int jersey_no; 8 | string country; 9 | }; 10 | 11 | int main() 12 | { 13 | // Cricketer dhoni1; // static 14 | Cricketer *dhoni = new Cricketer; // dynamic 15 | (*dhoni).jersey_no = 10; 16 | dhoni->country = "India"; 17 | 18 | Cricketer *kohli = new Cricketer; 19 | // kohli = dhoni; // point to the dhoni object 20 | 21 | kohli->jersey_no = dhoni->jersey_no; 22 | kohli->country = dhoni->country; 23 | 24 | delete dhoni; 25 | 26 | cout << "Dhoni- " << dhoni->jersey_no << " " << dhoni->country << endl; 27 | cout << "Kohli- " << kohli->jersey_no << " " << kohli->country << endl; 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-2/sort_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | int n; 5 | 6 | int *sort_fun() 7 | { 8 | cin >> n; 9 | int *arr = new int[n]; 10 | for (int i = 0; i < n; i++) 11 | { 12 | cin >> arr[i]; 13 | } 14 | // sort accending order 15 | sort(arr, arr + n); 16 | return arr; 17 | } 18 | 19 | int main() 20 | { 21 | int *return_arr = sort_fun(); 22 | for (int i = 0; i < n; i++) 23 | { 24 | cout << return_arr[i] << " "; 25 | } 26 | delete[] return_arr; 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 1-2/topics.txt: -------------------------------------------------------------------------------- 1 | 1. 2 | i) Module 3.5 practice 1 3 | ii) Best or Topper student 4 | 2. Module 3.5 practice 2 5 | 6 | 7 | 3. Array Accending/Descending Sort 8 | Size/N = 10^5, Numbers of items = N 9 | Selection sort complexity = O(N*N) = 10^10 10 | Built-in sort function complexity = O(N*log(N)) =17*10^5 =~ 10^7 11 | 12 | int* sort_fun(){ 13 | // int arr[n]; 14 | int* arr = new int[n]; 15 | 16 | // sort Accending 17 | sort(arr,arr+n); 18 | return arr; 19 | } 20 | 21 | 22 | 4. String or Character Array with/without space Accending/Descending sort 23 | 24 | 5. array A and array size N. Additionally, given a target T. four distinct indexed values summation equals target T. 25 | -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/0_input.txt: -------------------------------------------------------------------------------- 1 | String 2 | 1. Declaration + User Input 3 | 2. Input with Spaces 4 | 3. Useful Access Function 5 | 4. Useful Modification 6 | i. Concat using + 7 | ii. push_back and pop_back 8 | iii. Easy assignment using = 9 | iv. Erase // index 10 | v. insert // index 11 | vi. Replace 12 | 13 | 5. Find Function 14 | 6. Stringstream 15 | 7. Reverse Function 16 | 8. Sort Function 17 | 18 | 19 | Problem solving : 20 | 21 | 1.https://codeforces.com/group/MWSDmqGsZm/contest/219856/problem/H 22 | 2.https://codeforces.com/group/MWSDmqGsZm/contest/219856/problem/V 23 | -> replace (Homework) 24 | -> erase + insert -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/find.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | string s1; 7 | cin >> s1; 8 | 9 | if (s1.find("miny") != -1) 10 | { 11 | cout << "YEs" << endl; 12 | } 13 | else 14 | cout << "NO" << endl; 15 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/good_or_bad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | int t; 7 | cin >> t; 8 | 9 | for (int i = 0; i < t; i++) 10 | { 11 | 12 | string s; 13 | cin >> s; 14 | 15 | if (s.find("101") != -1 || s.find("010") != -1) 16 | { 17 | cout << "Good" << endl; 18 | } 19 | else 20 | cout << "Bad" << endl; 21 | } 22 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/line_input.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; 8 | getline(cin, s); 9 | 10 | cout << s << endl; 11 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/modification.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | // string s1, s2; 8 | // cin >> s1 >> s2; 9 | 10 | // s1 = s1 + s2; // concat , strcat 11 | 12 | // s1.push_back() ; // add a char to the end of the string 13 | 14 | // string s1; 15 | // cin >> s1; 16 | 17 | // s1.pop_back() ; // removes the last character 18 | 19 | string s1, s2; 20 | 21 | cin >> s1 >> s2; 22 | 23 | s1 = s2; // strcpy() 24 | 25 | cout << s1 << endl; 26 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/replace_word.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; 8 | cin >> s; 9 | 10 | while (1) 11 | { 12 | 13 | int index = s.find("EGYPT"); 14 | 15 | if (index != -1) 16 | { 17 | 18 | s.erase(index, 5); 19 | s.insert(index, " "); 20 | } 21 | else 22 | { 23 | break; 24 | } 25 | } 26 | cout << s << endl; 27 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/reverse_and_sort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | string s1; 7 | cin >> s1; 8 | 9 | // reverse(s1.begin(), s1.end()); 10 | 11 | sort(s1.begin(), s1.end()); // lexicographically sort hoise 12 | 13 | cout << s1 << endl; 14 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/string.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | 7 | string s; 8 | cin >> s; 9 | 10 | // cout << s.size() << endl; 11 | 12 | // s[2] = 'e'; 13 | 14 | // cout << s << endl; 15 | 16 | cout << s.front() << endl; // -> s[0] 17 | cout << s.back() << endl; // -> s[size-1] 18 | 19 | cout << endl; 20 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/string_functions.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | // string s1; 7 | // cin >> s1; 8 | 9 | // s1.erase(2, 3); // (index , koita character) 10 | // cout << s1.size() << endl; 11 | 12 | // cout << s1 << endl; 13 | 14 | // string s; 15 | // cin >> s; 16 | 17 | // s.insert(3, "gram"); 18 | 19 | // cout << s << endl; 20 | 21 | string s1; 22 | cin >> s1; 23 | 24 | s1.replace(2, 2, "ll"); 25 | 26 | cout << s1 << endl; 27 | } -------------------------------------------------------------------------------- /Batch 7/C++/Week 2-1/stringstream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | string s1; 7 | getline(cin, s1); 8 | 9 | stringstream ss; 10 | 11 | ss << s1; 12 | 13 | string word; 14 | 15 | while (ss >> word) 16 | { 17 | cout << word << endl; 18 | } 19 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/0_topics.txt: -------------------------------------------------------------------------------- 1 | 1. Printing with Escape Sequence 2 | 2. Data types and it's limitations 3 | -Typecasting 4 | 3. Divisibility 5 | 6 | Problem : https://codeforces.com/group/MWSDmqGsZm/contest/219158/problem/C 7 | 8 | 3. Printing the numbers from 1 to N , which are divisible by 4 or 13 9 | 10 | 4. Phitron Special Holiday version -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/data_type.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // newline 4 | 5 | int main() 6 | { 7 | int x; 8 | scanf("%d", &x); 9 | printf("%d", x); 10 | 11 | long long int y; 12 | scanf("%lld", &y); 13 | printf("%lld", y); 14 | 15 | double z; 16 | scanf("%lf", &z); 17 | printf("%.2lf", z); 18 | 19 | char c; 20 | scanf("%c", &c); 21 | printf("%c", c); 22 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/phitron_special.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int days; 7 | scanf("%d", &days); 8 | 9 | if (days > 3) 10 | { 11 | printf("Cox's bazar\n"); 12 | int remaining = days - 3; 13 | 14 | if (remaining >= 2) 15 | { 16 | printf("Saint Martin\n"); 17 | } 18 | } 19 | else if (days > 2) 20 | { 21 | printf("Restauarant\n"); 22 | } 23 | else 24 | { 25 | printf("Bashai thakbo\n"); 26 | } 27 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/print_four_thirteen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int x; 7 | scanf("%d", &x); 8 | 9 | if ((x % 4) == 0 || (x % 13) == 0) 10 | { 11 | 12 | printf("YES\n"); 13 | } 14 | else 15 | { 16 | printf("NO\n"); 17 | } 18 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/printing.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // newline 4 | 5 | int main() 6 | { 7 | int n; 8 | scanf("%d", &n); 9 | int a[n]; 10 | for (int i = 0; i < n; i++) 11 | { 12 | scanf("%d", &a[i]); 13 | } 14 | int rev_ar[n]; 15 | 16 | int j = 0; 17 | for (int i = n - 1; i >= 0; i--) 18 | { 19 | rev_ar[j] = a[i]; 20 | j++; 21 | } 22 | for (int i = 0; i < n; i++) 23 | { 24 | printf("%d ", rev_ar[i]); 25 | } 26 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/printing_range.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | for (int i = 1; i <= n; i++) 10 | { 11 | 12 | if ((i % 4) == 0 || (i % 13) == 0) 13 | { 14 | printf("%d\n", i); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 1/simple_calc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int x, y; 7 | scanf("%d %d", &x, &y); 8 | 9 | int add = x + y; 10 | int sub = x - y; 11 | long long int mul = (long long int)x * y; 12 | 13 | printf("%d + %d = %d\n", x, y, add); 14 | printf("%d * %d = %lld\n", x, y, mul); 15 | printf("%d - %d = %d\n", x, y, sub); 16 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 2/1_N.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | // printf("%d", n); 8 | for (int i = 1; i <= n; i++) 9 | { 10 | printf("%d ", i); 11 | } 12 | return 0; 13 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 2/N_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | // printf("%d", n); 8 | for (int i = n; i >= 1; i--) 9 | { 10 | printf("%d ", i); 11 | } 12 | return 0; 13 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 2/pos_neg_N.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | 8 | if (n > 0) 9 | { 10 | for (int i = 1; i <= n; i++) 11 | { 12 | printf("%d ", i); 13 | } 14 | } 15 | 16 | if (n < 0) 17 | { 18 | for (int i = n; i <= 0; i++) 19 | { 20 | printf("%d ", i); 21 | } 22 | } 23 | 24 | return 0; 25 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 2/problem1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | // printf("%d", n); 8 | for (int i = n; i >= 1; i--) 9 | { 10 | // printf("%d. ", i); 11 | printf("%d. I love practice\n", i); 12 | } 13 | return 0; 14 | } -------------------------------------------------------------------------------- /Batch 7/C/Special Session - Assignment 2/topics.txt: -------------------------------------------------------------------------------- 1 | Problem solving with conditional statement, Loop, Array and Assignment-2 Exam Preparation: 2 | 3 | 1. Print "I love practice" 1 to N times given format: 4 | N. I love practice 5 | . 6 | . 7 | 4. I love practice 8 | 3. I love practice 9 | 2. I love practice 10 | 1. I love practice 11 | 12 | 13 | 2. 1-N print(loop), 14 | N-1 print(loop), 15 | 1-N(positive) or N-0(negative) print depend on N value (loop), 16 | sum of positive and negative from array (array). 17 | 18 | 3. print all the values of Array at even_indexes in reverse way. (index starts from 0 or 0 index based) 19 | + update index value. 20 | 21 | 22 | Note: Introduction to programming language week 02 >>>>> Week-2 Conceptual-2: part 1 and part 2 23 | -------------------------------------------------------------------------------- /Batch 7/C/Week 1-2/0_topics.txt: -------------------------------------------------------------------------------- 1 | 1. Loop Recap 2 | 3 | 4 | Problem solving : 5 | 1. Number from 1 to N divisible by 3 and 7 6 | 2. https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/K 7 | 3. https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/S 8 | 4. https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/G 9 | 10 | -------------------------------------------------------------------------------- /Batch 7/C/Week 1-2/divisors.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int N; 7 | scanf("%d", &N); 8 | 9 | for (int i = 1; i <= N; i++) 10 | { 11 | if (N % i == 0) 12 | { 13 | printf("%d\n", i); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 1-2/factorial.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int t; 7 | scanf("%d", &t); 8 | 9 | for (int tc = 1; tc <= t; tc++) 10 | { 11 | 12 | int n; 13 | scanf("%d", &n); 14 | 15 | long long int fact = 1; 16 | 17 | for (int i = 1; i <= n; i++) 18 | { 19 | fact = fact * i; 20 | } 21 | 22 | printf("%lld\n", fact); 23 | } 24 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 1-2/for_loop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | 8 | while (n != 0) // condition 9 | { 10 | n = n / 2; 11 | } 12 | printf("%d", n); 13 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 1-2/odd_sum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int T; 7 | scanf("%d", &T); 8 | 9 | for (int tc = 1; tc <= T; tc++) 10 | { 11 | 12 | int X, Y; 13 | scanf("%d %d", &X, &Y); 14 | 15 | if (X > Y) 16 | { 17 | int temp = X; 18 | X = Y; 19 | Y = temp; 20 | } 21 | 22 | int sum = 0; 23 | 24 | for (int i = X + 1; i < Y; i++) 25 | { 26 | if (i % 2 != 0) 27 | { 28 | sum = sum + i; 29 | } 30 | } 31 | printf("%d\n", sum); 32 | } 33 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 1-2/problem_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | 8 | int count = 0; 9 | 10 | for (int i = 1; i <= n; i++) 11 | { 12 | if (i % 3 == 0 && i % 7 == 0) 13 | { 14 | // printf("%d\n", i); 15 | count++; 16 | } 17 | } 18 | 19 | printf("%d", count); 20 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-1/0_topics.txt: -------------------------------------------------------------------------------- 1 | 2 | How Online Judge Works ( General Explanation to understand it better ) 3 | 4 | 5 | Problem solving 6 | 1. https://codeforces.com/problemset/problem/1866/A 7 | 2. https://codeforces.com/group/MWSDmqGsZm/contest/326175/problem/I 8 | 9 | 10 | Recap of Nested Loop: 11 | 1. https://judge.phitron.io/topics/cm5z7wa3u0007p301xbzdqkuk/cm86d15s50092r001qeu2gb0t?language=c_103 12 | 2. https://judge.phitron.io/topics/cm5z7wa3u0007p301xbzdqkuk/cm86d8btu009er001s04tfa7u?language=c_103 13 | -------------------------------------------------------------------------------- /Batch 7/C/Week 2-1/Lucky.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | int first_digit = n / 10; 10 | int second_digit = n % 10; 11 | 12 | if (second_digit == 0) 13 | { 14 | printf("YES\n"); 15 | } 16 | else if (first_digit % second_digit == 0 || second_digit % first_digit == 0) 17 | { 18 | printf("YES\n"); 19 | } 20 | else 21 | { 22 | printf("NO\n"); 23 | } 24 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-1/Pattern-2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | scanf("%d", &n); 8 | 9 | for (int i = 1; i <= n; i++) 10 | { 11 | for (int j = 1; j <= i; j++) // row সংখ্যক h print korbe 12 | { 13 | printf("%c ", 64 + i); 14 | } 15 | 16 | printf("\n"); 17 | } 18 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-1/ambitious.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | int n; 8 | scanf("%d", &n); 9 | 10 | int min_num = 100000 + 1; 11 | 12 | for (int i = 1; i <= n; i++) 13 | { 14 | int x; 15 | scanf("%d", &x); 16 | 17 | if (x < 0) 18 | { 19 | x = x * (-1); 20 | } 21 | // x = abs(x) ; 22 | 23 | if (x < min_num) 24 | { 25 | min_num = x; 26 | } 27 | } 28 | 29 | printf("%d\n", min_num); 30 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/E_lowest_number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | 7 | int arr[n]; 8 | for (int i = 0; i < n; i++) 9 | { 10 | scanf("%d", &arr[i]); 11 | } 12 | 13 | int min = 1e5 + 1, min_pos = -1; 14 | for (int i = 0; i < n; i++) 15 | { 16 | if (arr[i] < min) 17 | { 18 | min = arr[i]; 19 | min_pos = i + 1; // 1 index based 20 | } 21 | } 22 | printf("%d %d", min, min_pos); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/even_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | 7 | int arr[n]; 8 | for (int i = 0; i < n; i++) 9 | { 10 | scanf("%d", &arr[i]); 11 | } 12 | 13 | for (int i = n - 1; i >= 0; i--) 14 | { 15 | if (i % 2 == 0) 16 | { 17 | printf("%d ", arr[i]); 18 | } 19 | 20 | } 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/modify_array_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | int arr[n]; 7 | 8 | // arr[0]=1; 9 | // arr[1]=5; 10 | // arr[2]=10; 11 | // arr[3]=15; 12 | 13 | for (int i = 0; i < n; i++) 14 | { 15 | scanf("%d", &arr[i]); 16 | } 17 | 18 | int idx, val; 19 | scanf("%d %d", &idx, &val); 20 | 21 | // modify index value 22 | arr[idx] = val; 23 | 24 | // reverse 25 | for (int i = n - 1; i >= 0; i--) 26 | { 27 | printf("%d ", arr[i]); 28 | } 29 | 30 | return 0; 31 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/print_n.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | 7 | if (n > 0) 8 | { 9 | for (int i = 1; i <= n; i++) 10 | { 11 | printf("%d ", i); 12 | } 13 | } 14 | else 15 | { 16 | for (int i = n; i <= 0; i++) 17 | { 18 | printf("%d ", i); 19 | } 20 | } 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/searching.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | 7 | int arr[n]; 8 | for (int i = 0; i < n; i++) 9 | { 10 | scanf("%d", &arr[i]); 11 | } 12 | 13 | int x; 14 | scanf("%d", &x); 15 | 16 | for (int i = 0; i < n; i++) 17 | { 18 | if (arr[i] == x) 19 | { 20 | printf("%d", i); 21 | // break; 22 | return 0; 23 | } 24 | } 25 | 26 | printf("-1"); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/sum_pos_neg.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | scanf("%d", &n); 6 | 7 | int arr[n]; 8 | // for (int i = 0; i < n; i++) 9 | // { 10 | // scanf("%d", &arr[i]); 11 | // } 12 | 13 | int sum_pos = 0, sum_neg = 0; 14 | for (int i = 0; i < n; i++) 15 | { 16 | scanf("%d", &arr[i]); // 10^5>n 17 | if (arr[i] > 0) 18 | { 19 | sum_pos += arr[i]; 20 | } 21 | else 22 | { 23 | sum_neg += arr[i]; 24 | } 25 | } 26 | printf("%d %d", sum_pos, sum_neg); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 2-2/topics.txt: -------------------------------------------------------------------------------- 1 | Problem solving with Loop and Array (Array recap): 2 | 1. 3 | i) 1-N print(loop), 4 | ii) N-1 print(loop), 5 | iii) 1-N(positive) or N-0(negative) print depend on N value (loop), 6 | iv) sum of positive and negative from array (array). 7 | 8 | 2. i) print all the values of Array at even_indexes in reverse way. (index starts from 0 or 0 index based) 9 | ii) update or modify index'th value then print reverse. 10 | 11 | Array Constraints: 12 | 1 <= N <= 10^6 13 | 14 | 15 | Codeforces Problem: 16 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/B 17 | 2. https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/E 18 | -------------------------------------------------------------------------------- /Batch 7/C/Week 3-1/0_topics.txt: -------------------------------------------------------------------------------- 1 | 2 | Trending Problem : 3 | 4 | 1. Smallest Pair 5 | ( https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/I ) 6 | 7 | 8 | String Operations: 9 | 1. Insertion 10 | 2. Deletion 11 | 12 | 13 | Reverse of an Array/ String: 14 | https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/F 15 | 16 | 17 | 18 | 19 | Palindrome Problem : 20 | 1. https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/G ( Array ) 21 | 2.https://codeforces.com/group/MWSDmqGsZm/contest/219856/problem/I (String ) 22 | 23 | 1. Naive ( Using Extra String ) 24 | 2. Two Pointers -------------------------------------------------------------------------------- /Batch 7/C/Week 3-1/palindrome_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | 8 | scanf("%d", &n); 9 | 10 | int a[n]; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | scanf("%d", &a[i]); 15 | } 16 | 17 | int l = 0, r = n - 1; 18 | 19 | int palindrome = 1; 20 | 21 | while (l < r) 22 | { 23 | if (a[l] != a[r]) 24 | { 25 | palindrome = 0; 26 | break; 27 | } 28 | 29 | // pointer movement 30 | l++; 31 | r--; 32 | } 33 | 34 | if (palindrome == 1) 35 | { 36 | printf("YES\n"); 37 | } 38 | else 39 | { 40 | printf("NO\n"); 41 | } 42 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-1/palindrome_string.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char a[1001]; 6 | 7 | scanf("%s", &a); 8 | 9 | int l = 0, r = strlen(a) - 1; 10 | 11 | int palindrome = 1; 12 | 13 | while (l < r) 14 | { 15 | if (a[l] != a[r]) 16 | { 17 | palindrome = 0; 18 | break; 19 | } 20 | 21 | // pointer movement 22 | l++; 23 | r--; 24 | } 25 | 26 | if (palindrome == 1) 27 | { 28 | printf("YES\n"); 29 | } 30 | else 31 | { 32 | printf("NO\n"); 33 | } 34 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-1/reverse.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | 8 | scanf("%d", &n); 9 | 10 | int a[n]; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | scanf("%d", &a[i]); 15 | } 16 | 17 | int rev[n]; 18 | 19 | int j = 0; 20 | 21 | for (int i = n - 1; i >= 0; i--) 22 | { 23 | 24 | rev[j] = a[i]; 25 | j++; 26 | } 27 | 28 | for (int i = 0; i < n; i++) 29 | { 30 | printf("%d ", rev[i]); 31 | } 32 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-1/reverse_two.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int n; 7 | 8 | scanf("%d", &n); 9 | 10 | int a[n]; 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | scanf("%d", &a[i]); 15 | } 16 | 17 | int l = 0, r = n - 1; 18 | 19 | while (l < r) 20 | { 21 | 22 | // swapping 23 | int temp = a[l]; 24 | a[l] = a[r]; 25 | a[r] = temp; 26 | 27 | // pointer movement 28 | l++; 29 | r--; 30 | } 31 | 32 | for (int i = 0; i < n; i++) 33 | { 34 | printf("%d ", a[i]); 35 | } 36 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-1/strings.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | char name[8]; 8 | 9 | scanf("%s", &name); 10 | printf("%s", name); 11 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-2/Count_letters.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char s[10000001]; 7 | scanf("%s", &s); 8 | int freq[26] = {0}; 9 | int len = strlen(s); 10 | for (int i = 0; i < len; i++) 11 | { 12 | // printf("%d ", s[i]); 13 | int idx = s[i] - 97; 14 | // printf("%d \n", idx); 15 | freq[idx]++; 16 | } 17 | for (int i = 0; i < 26; i++) 18 | { 19 | if (freq[i] > 0) 20 | { 21 | printf("%c : %d\n", i + 97, freq[i]); 22 | } 23 | } 24 | return 0; 25 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-2/digits_count.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | char s[100]; 6 | scanf("%s", &s); 7 | int count_digit = 0; 8 | for (int i = 0; i < strlen(s); i++) 9 | { 10 | // count digit 11 | // '0' = 48 , '9'=57 12 | if (s[i] >= '0' && s[i] <= '9') 13 | { 14 | // digit 15 | count_digit++; 16 | } 17 | } 18 | printf("%d", count_digit); 19 | return 0; 20 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 3-2/programmer.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | double n, d; 5 | scanf("%lf %lf", &n, &d); 6 | 7 | double m; 8 | scanf("%lf", &m); 9 | double howManyDay = d * n / (n + m); 10 | printf("%lf\n", howManyDay); 11 | if (howManyDay - (int)howManyDay == 0) 12 | { 13 | printf("%d\n", (int)howManyDay); // double data to int data 14 | } 15 | else 16 | { 17 | printf("%d\n", (int)howManyDay + 1); 18 | } 19 | double reduce_day = d - howManyDay; // 20 | 21 | printf("%lf", reduce_day); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /Batch 7/C/Week 3-2/vowels.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | char s[100]; 6 | scanf("%s", &s); 7 | int cnt = 0; 8 | for (int i = 0; i < strlen(s); i++) 9 | { 10 | // vowels count a,e,i,o,u, A,E,I,O,U 11 | if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u') 12 | { 13 | cnt++; 14 | } 15 | } 16 | printf("%d", cnt); 17 | return 0; 18 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-1/pattern_alphabet.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void alphabet_printer(int count) 4 | { 5 | for (int i = 0; i <= count; i++) 6 | { 7 | printf("%c", i + 'a'); 8 | } 9 | } 10 | 11 | int main() 12 | { 13 | 14 | int n; 15 | scanf("%d", &n); 16 | 17 | int counter = 0; 18 | 19 | for (int i = 1; i <= n; i++) 20 | { 21 | alphabet_printer(counter); 22 | printf("\n"); 23 | counter += 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Batch 7/C/Week 4-1/type_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // return type function_name ( parameters){ 4 | // working procedures / Instructions 5 | 6 | //} 7 | 8 | int summation_of_first_last_digit(int n) 9 | { 10 | 11 | int last_digit = n % 10; 12 | int first_digit = n / 1000; 13 | 14 | int sum = first_digit + last_digit; 15 | 16 | return sum; 17 | } 18 | 19 | int main() 20 | { 21 | 22 | int N; 23 | scanf("%d", &N); 24 | 25 | int ans = summation_of_first_last_digit(N); 26 | 27 | printf("%d", ans); 28 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-1/type_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // return type function_name ( parameters){ 4 | // working procedures / Instructions 5 | //} 6 | 7 | void printing_n_values(int n) 8 | { 9 | if (n > 0) 10 | { 11 | for (int i = n; i >= -n; i--) 12 | { 13 | printf("%d ", i); 14 | } 15 | } 16 | else 17 | { 18 | for (int i = n; i <= -n; i++) 19 | { 20 | printf("%d ", i); 21 | } 22 | } 23 | } 24 | 25 | int main() 26 | { 27 | 28 | int N; 29 | scanf("%d", &N); 30 | printing_n_values(N); 31 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-1/type_3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float PIE() 4 | { 5 | return 3.1416; 6 | } 7 | 8 | int main() 9 | { 10 | 11 | printf("%f", PIE()); 12 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-1/type_4.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printing_even_array() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | int ar[n]; 8 | 9 | for (int i = 0; i < n; i++) 10 | { 11 | scanf("%d", &ar[i]); 12 | if (i % 2 == 0) 13 | { 14 | printf("%d ", ar[i]); 15 | } 16 | } 17 | } 18 | 19 | int main() 20 | { 21 | printing_even_array(); 22 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-2/Max_Min.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void min_max_print(int arr[], int n) 5 | { 6 | int min = INT_MAX, max = INT_MIN; 7 | for (int i = 0; i < n; i++) 8 | { 9 | if (min > arr[i]) 10 | { 11 | min = arr[i]; 12 | } 13 | else if (max < arr[i]) 14 | { 15 | max = arr[i]; 16 | } 17 | } 18 | 19 | printf("%d %d\n", min, max); 20 | } 21 | int main() 22 | { 23 | int n; 24 | scanf("%d", &n); 25 | int arr[n]; 26 | for (int i = 0; i < n; i++) 27 | { 28 | scanf("%d", &arr[i]); 29 | } 30 | 31 | min_max_print(arr, n); 32 | return 0; 33 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-2/count_odd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int count_odd(int arr[], int n) 5 | { 6 | int cnt = 0; 7 | for (int i = 0; i < n; i++) 8 | { 9 | if (arr[i] % 2 != 0) 10 | { 11 | cnt++; 12 | } 13 | } 14 | return cnt; 15 | } 16 | int main() 17 | { 18 | int n; 19 | scanf("%d", &n); 20 | int arr[n]; 21 | for (int i = 0; i < n; i++) 22 | { 23 | scanf("%d", &arr[i]); 24 | } 25 | 26 | printf("%d", count_odd(arr, n)); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-2/pos_neg_zero.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | bool pos_neg_zero(int n) 4 | { 5 | if (n > 0) 6 | { 7 | // return 1; 8 | return true; 9 | } 10 | else if (n < 0) 11 | { 12 | // return -1; 13 | return false; 14 | } 15 | // else if (n == 0) 16 | // { 17 | // return 0; 18 | // } 19 | } 20 | int main() 21 | { 22 | int n; 23 | scanf("%d", &n); 24 | bool val = pos_neg_zero(n); 25 | if (val == true) 26 | { 27 | printf("Positive"); 28 | } 29 | else if (val == false) 30 | { 31 | printf("Negative"); 32 | } 33 | // else if (val == 0) 34 | else 35 | { 36 | printf("Zero"); 37 | } 38 | return 0; 39 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-2/sort_numbers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a, b, c; 6 | scanf("%d %d %d", &a, &b, &c); 7 | int min, mid, max; 8 | if (a < b && a < c) 9 | { 10 | min = a; 11 | if (b < c) 12 | { 13 | mid = b; 14 | max = c; 15 | } 16 | else 17 | { 18 | mid = c; 19 | max = b; 20 | } 21 | } 22 | return 0; 23 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 4-2/swap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void swap(int *a, int *b) 4 | { 5 | int tmp = *a; 6 | *a = *b; 7 | *b = tmp; 8 | } 9 | int main() 10 | { 11 | int a, b; 12 | scanf("%d %d", &a, &b); 13 | // int tmp = a; 14 | // a = b; 15 | // b = tmp; 16 | swap(&a, &b); 17 | printf("%d %d", a, b); 18 | return 0; 19 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-1/0_topic.txt: -------------------------------------------------------------------------------- 1 | Recursion 2 | 1. What is recursion 3 | 2. How to think 4 | 3. How it works 5 | 6 | Problems : 7 | 1. Print Recursion ( https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/A) 8 | 2. Print from 1 to N (https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/B) 9 | 3. Print from N to 1 ( https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/C) 10 | 11 | 12 | Note : Recursive leap of faith -------------------------------------------------------------------------------- /Batch 7/C/Week 5-1/basic_recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void print(int n) 4 | { 5 | 6 | // base case 7 | if (n == 0) 8 | { 9 | return; 10 | } 11 | 12 | printf("hello"); 13 | print(n - 1); // recursive call 14 | } 15 | 16 | int main() 17 | { 18 | 19 | print(3); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-1/function.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pi_2() 4 | { 5 | return 3; 6 | } 7 | 8 | int pi() 9 | { 10 | int x = pi_2(); 11 | return x; 12 | } 13 | 14 | int main() 15 | { 16 | 17 | printf("%d", pi()); 18 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-1/print_from_1_to_N.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printer(int n) 4 | { 5 | 6 | if (n == 0) 7 | { 8 | return; 9 | } 10 | printer(n - 1); // 1 to n-1 print 11 | printf("%d\n", n); // n print korbe 12 | } 13 | 14 | int main() 15 | { 16 | 17 | int n; 18 | scanf("%d", &n); 19 | 20 | printer(n); 21 | 22 | // ei function e n bole dile function ta 23 | // 1 to N porjonto print kore dibe 24 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-1/print_from_N_to_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printer(int n) 4 | { 5 | 6 | if (n == 1) 7 | { 8 | printf("%d", n); 9 | return; 10 | } 11 | 12 | printf("%d ", n); 13 | printer(n - 1); 14 | } 15 | 16 | int main() 17 | { 18 | 19 | int n; 20 | scanf("%d", &n); 21 | 22 | printer(n); 23 | 24 | // ei function er kaj N theke 1 porjonto print kora 25 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-1/print_recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printer(int n) 4 | { 5 | if (n == 0) 6 | { 7 | return; 8 | } 9 | printf("I love Recursion\n"); 10 | printer(n - 1); 11 | } 12 | 13 | int main() 14 | { 15 | 16 | int n; 17 | scanf("%d", &n); 18 | 19 | printer(n); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-2/K_Max_Number.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int findMax(int a[], int n, int idx) 4 | { 5 | if (idx == n) 6 | { 7 | return INT_MIN; 8 | } 9 | // if (idx == n - 1) 10 | // { 11 | // return a[idx]; // a[n-1] 12 | // } 13 | int max_v = findMax(a, n, idx + 1); 14 | if (a[idx] > max_v) 15 | { 16 | return a[idx]; 17 | } 18 | else 19 | { 20 | return max_v; 21 | } 22 | } 23 | int main() 24 | { 25 | int n; 26 | scanf("%d", &n); 27 | int arr[n]; 28 | for (int i = 0; i < n; i++) 29 | { 30 | scanf("%d", &arr[i]); 31 | } 32 | 33 | int max_value = findMax(arr, n, 0); 34 | 35 | printf("%d\n", max_value); 36 | return 0; 37 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-2/L_Summation.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | long long int sum_rec(long long int a[], int n, int idx) 4 | { 5 | if (idx == n) 6 | { 7 | return 0; 8 | } 9 | // if (idx == n - 1) 10 | // { 11 | // return a[idx]; // a[n-1] 12 | // } 13 | long long int sum_v = sum_rec(a, n, idx + 1); 14 | return a[idx] + sum_v; 15 | } 16 | int main() 17 | { 18 | int n; 19 | scanf("%d", &n); 20 | 21 | long long int arr[n]; 22 | for (int i = 0; i < n; i++) 23 | { 24 | scanf("%lld", &arr[i]); 25 | } 26 | 27 | long long int sum_value = sum_rec(arr, n, 0); 28 | 29 | printf("%lld\n", sum_value); 30 | return 0; 31 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-2/first_row_col.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int r, c; 5 | scanf("%d %d", &r, &c); 6 | int matrix[r][c]; 7 | for (int i = 0; i < r; i++) 8 | { 9 | for (int j = 0; j < c; j++) 10 | { 11 | scanf("%d", &matrix[i][j]); 12 | } 13 | } 14 | int spe_r = 0; // first row 15 | 16 | for (int j = 0; j < c; j++) 17 | { 18 | printf("%d ", matrix[spe_r][j]); 19 | } 20 | printf("\n"); 21 | 22 | int spe_c = 0; // first column 23 | for (int j = 0; j < r; j++) 24 | { 25 | printf("%d ", matrix[j][spe_c]); 26 | } 27 | printf("\n"); 28 | return 0; 29 | } -------------------------------------------------------------------------------- /Batch 7/C/Week 5-2/topics.txt: -------------------------------------------------------------------------------- 1 | 1. K. Max Number (https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/K) 2 | 2. L. Summation (https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/L) 3 | 3. A. Beautiful Matrix (https://codeforces.com/problemset/problem/263/A) 4 | 5 | 6 | 4. n*m Matrix. print first row and first column from that Matrix. 7 | 8 | 4 3 9 | 1 2 3 10 | 5 6 7 11 | 6 5 4 12 | 3 5 4 13 | output: 14 | 1 2 3 15 | 1 5 6 3 16 | 17 | 18 | 5. array A and size N. copy of this array named B in ascending order. make another array C, where each index i (0 <= i < N) of array C is the multiplication between array A[i] and B[i]. 19 | 20 | N = 5 21 | A = 5 3 1 2 4 22 | B = 1 2 3 4 5 23 | C = 5 6 3 8 20 24 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/icon/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/icon/0.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/icon/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/icon/1.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/icon/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/icon/2.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/images/background.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/images/banner.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/images/product-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/images/product-1.jpg -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/images/product-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/images/product-2.jpg -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/images/product-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/images/product-3.jpg -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/images/section.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/images/section.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/logo/logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/logo/logo-dark.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 1-1/logo/logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 1-1/logo/logo-light.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/accounts/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'accounts' 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/forms.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.forms import UserCreationForm 2 | from django.contrib.auth.models import User 3 | 4 | 5 | class RegistrationForm(UserCreationForm): 6 | def __init__(self, *args, **kwargs): 7 | super(UserCreationForm, self).__init__(*args, **kwargs) 8 | 9 | fields = ['first_name', 'last_name', 'username', 'email', 'password1', 'password2'] 10 | 11 | for fieldName in fields: 12 | self.fields[fieldName].help_text = None 13 | self.fields[fieldName].widget.attrs.update({'class': 'form-control'}) 14 | 15 | 16 | class Meta: 17 | model = User 18 | fields = ['first_name', 'last_name', 'username', 'email', 'password1', 'password2'] -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/templates/accounts/login.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 | {{ form }} 8 | 9 |
10 |
11 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/templates/accounts/register.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 | {{ form }} 8 | 9 |
10 |
11 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/accounts/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from accounts.views import registrationView, loginView, logoutView 3 | 4 | urlpatterns = [ 5 | path('register/', registrationView, name="register"), 6 | path('login/', loginView, name='login'), 7 | path('logout', logoutView, name='logout') 8 | ] 9 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/db.sqlite3 -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mealProject.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/mealProject/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/mealProject/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/mealProject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for mealProject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mealProject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/mealProject/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path, include 4 | from meals.views import show_meals 5 | from django.conf.urls.static import static 6 | from django.conf import settings 7 | 8 | 9 | urlpatterns = [ 10 | path('admin/', admin.site.urls), 11 | path('', show_meals, name='meals'), 12 | path('meals/', include('meals.urls')), 13 | path('accounts/', include('accounts.urls')) 14 | ] 15 | 16 | urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/mealProject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mealProject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mealProject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/meals/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from meals.models import Category, Food 3 | 4 | # Register your models here. 5 | 6 | admin.site.register(Category) 7 | admin.site.register(Food) -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MealsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'meals' 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm, Textarea 2 | from meals.models import Food 3 | 4 | class MealAddForm(ModelForm): 5 | def __init__(self, *args, **kwargs): 6 | super(ModelForm, self).__init__(*args, **kwargs) 7 | # self.fields['food_name'].widget.attrs.update({'class': 'form-control'})\ 8 | for field_name in self.fields: 9 | self.fields[field_name].widget.attrs.update({'class': 'form-control'}) 10 | 11 | class Meta: 12 | model = Food 13 | fields = '__all__' 14 | 15 | labels = { 16 | 'category': 'Food Category' 17 | } 18 | 19 | widgets = { 20 | 'food_description': Textarea(attrs={'rows': 4}) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/migrations/0002_food_image.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.0.6 on 2024-05-30 15:16 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('meals', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='food', 15 | name='image', 16 | field=models.ImageField(default='meals/images/default.png', upload_to='meals/images'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/meals/migrations/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Category(models.Model): 5 | category_name = models.CharField(max_length=50) 6 | 7 | def __str__(self) -> str: 8 | return self.category_name 9 | 10 | class Food(models.Model): 11 | food_name = models.CharField(max_length=250) 12 | food_description = models.CharField(max_length=400) 13 | category = models.ForeignKey(Category, on_delete=models.CASCADE) 14 | image = models.ImageField(upload_to='meals/images', default='meals/images/default.png') 15 | 16 | def __str__(self): 17 | return self.food_name 18 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/templates/meals/index.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | 4 | {% block content %} 5 | {% for food in foods %} 6 | 7 |

{{food.food_name}}

8 |

{{food.food_description}}

9 | {% endfor %} 10 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/templates/meals/meal_add.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 | {{ form }} 8 | 9 |
10 |
11 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from meals.views import add_meal 3 | 4 | urlpatterns = [ 5 | path('add_meal/', add_meal, name='add-meal') 6 | ] 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/meals/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from meals.models import Food, Category 3 | from meals.forms import MealAddForm 4 | from django.shortcuts import redirect 5 | 6 | 7 | # Create your views here. 8 | def show_meals(request): 9 | foods = Food.objects.all() 10 | print(foods) 11 | return render(request, 'meals/index.html', {'foods': foods}) 12 | 13 | def add_meal(request): 14 | form = MealAddForm() 15 | if request.method == 'POST': 16 | form = MealAddForm(request.POST, request.FILES) 17 | if form.is_valid(): 18 | print(form.cleaned_data) 19 | form.save() 20 | return redirect('meals') 21 | return render(request, 'meals/meal_add.html', {'form': form}) -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/media/meals/images/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/media/meals/images/default.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/media/meals/images/images.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/media/meals/images/images.jpeg -------------------------------------------------------------------------------- /Batch-4/Django/Week 4-2/mealProject/media/meals/images/images_ssnzoBp.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 4-2/mealProject/media/meals/images/images_ssnzoBp.jpeg -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/accounts/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'accounts' 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/forms.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.forms import UserCreationForm 2 | from django.contrib.auth.models import User 3 | 4 | 5 | class RegistrationForm(UserCreationForm): 6 | def __init__(self, *args, **kwargs): 7 | super(UserCreationForm, self).__init__(*args, **kwargs) 8 | 9 | fields = ['first_name', 'last_name', 'username', 'email', 'password1', 'password2'] 10 | 11 | for fieldName in fields: 12 | self.fields[fieldName].help_text = None 13 | self.fields[fieldName].widget.attrs.update({'class': 'form-control'}) 14 | 15 | 16 | class Meta: 17 | model = User 18 | fields = ['first_name', 'last_name', 'username', 'email', 'password1', 'password2'] -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/templates/accounts/login.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 | {{ form }} 8 | 9 |
10 |
11 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/templates/accounts/register.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 | {{ form }} 8 | 9 |
10 |
11 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/accounts/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from accounts.views import customRegistrationView, loginView, CustomlogoutView 3 | from django.contrib.auth.views import LoginView 4 | 5 | 6 | urlpatterns = [ 7 | # path('register/', registrationView, name="register"), 8 | path('register/', customRegistrationView.as_view(), name='register'), 9 | # path('login/', loginView, name='login'), 10 | path('login/', LoginView.as_view(template_name = 'accounts/login.html'), name='login'), 11 | # path('logout', logoutView, name='logout') 12 | path('logout/', CustomlogoutView.as_view(), name='logout') 13 | ] 14 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/db.sqlite3 -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mealProject.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/mealProject/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/mealProject/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/mealProject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for mealProject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mealProject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/mealProject/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path, include 4 | from meals.views import show_meals 5 | from django.conf.urls.static import static 6 | from django.conf import settings 7 | 8 | 9 | urlpatterns = [ 10 | path('admin/', admin.site.urls), 11 | path('', show_meals, name='meals'), 12 | path('meals/', include('meals.urls')), 13 | path('accounts/', include('accounts.urls')) 14 | ] 15 | 16 | urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/mealProject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mealProject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mealProject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/meals/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from meals.models import Category, Food 3 | 4 | # Register your models here. 5 | 6 | admin.site.register(Category) 7 | admin.site.register(Food) -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MealsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'meals' 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm, Textarea 2 | from meals.models import Food 3 | 4 | class MealAddForm(ModelForm): 5 | def __init__(self, *args, **kwargs): 6 | super(ModelForm, self).__init__(*args, **kwargs) 7 | # self.fields['food_name'].widget.attrs.update({'class': 'form-control'})\ 8 | for field_name in self.fields: 9 | self.fields[field_name].widget.attrs.update({'class': 'form-control'}) 10 | 11 | class Meta: 12 | model = Food 13 | fields = '__all__' 14 | 15 | labels = { 16 | 'category': 'Food Category' 17 | } 18 | 19 | widgets = { 20 | 'food_description': Textarea(attrs={'rows': 4}) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/migrations/0002_food_image.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.0.6 on 2024-05-30 15:16 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('meals', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='food', 15 | name='image', 16 | field=models.ImageField(default='meals/images/default.png', upload_to='meals/images'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/meals/migrations/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Category(models.Model): 5 | category_name = models.CharField(max_length=50) 6 | 7 | def __str__(self) -> str: 8 | return self.category_name 9 | 10 | class Food(models.Model): 11 | food_name = models.CharField(max_length=250) 12 | food_description = models.CharField(max_length=400) 13 | category = models.ForeignKey(Category, on_delete=models.CASCADE) 14 | image = models.ImageField(upload_to='meals/images', default='meals/images/default.png') 15 | 16 | def __str__(self): 17 | return self.food_name 18 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/templates/meals/index.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | 4 | {% block content %} 5 | {% for food in foods %} 6 | 7 |

{{food.food_name}}

8 |

{{food.food_description}}

9 | {% endfor %} 10 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/templates/meals/meal_add.html: -------------------------------------------------------------------------------- 1 | {% extends "core/base.html" %} 2 | 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 | {{ form }} 8 | 9 |
10 |
11 | {% endblock content %} -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/meals/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from meals.views import add_meal 3 | 4 | urlpatterns = [ 5 | path('add_meal/', add_meal.as_view(), name='add-meal') 6 | ] 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/media/meals/images/Chicken-Fried-Rice-square-FS-.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/media/meals/images/Chicken-Fried-Rice-square-FS-.jpg -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/media/meals/images/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/media/meals/images/default.png -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/media/meals/images/images.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/media/meals/images/images.jpeg -------------------------------------------------------------------------------- /Batch-4/Django/Week 6-1/mealProject/media/meals/images/images_ssnzoBp.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week 6-1/mealProject/media/meals/images/images_ssnzoBp.jpeg -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/.gitignore: -------------------------------------------------------------------------------- 1 | .venv 2 | Others/info.txt 3 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/Others/commands.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | > python -m venv .venv 4 | > .venv\Scripts\Activate.ps1 5 | (.venv) > python -m pip install django~=4.0.0 6 | (.venv) > django-admin startproject django_project . 7 | (.venv) > python manage.py startapp app_name 8 | (.venv) > python manage.py migrate 9 | 10 | 11 | 12 | python manage.py startapp accounts 13 | 14 | python manage.py makemigrations 15 | python manage.py migrate 16 | python manage.py createsuperuser 17 | 18 | 19 | python manage.py startapp posts 20 | python manage.py makemigrations posts 21 | 22 | ---------- 23 | 24 | python -m pip install djangorestframework 25 | - 26 | python -m pip install django-cors-headers 27 | - 28 | python -m pip install dj-rest-auth 29 | - 30 | python -m pip install django-allauth 31 | pip install requests 32 | 33 | 34 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/README.md: -------------------------------------------------------------------------------- 1 | http://127.0.0.1:8000/api/posts/ 2 | http://127.0.0.1:8000/api/posts// 3 | 4 | http://127.0.0.1:8000/api/auth/login/ 5 | http://127.0.0.1:8000/api/auth/logout/ 6 | http://127.0.0.1:8000/api/auth/reset/password/ 7 | http://127.0.0.1:8000/api/auth/reset/password/confirm/ 8 | http://127.0.0.1:8000/api/auth/register/ 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week-8/backend/accounts/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import CustomUser 3 | 4 | admin.site.register(CustomUser) 5 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'accounts' 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/migrations/0002_remove_customuser_name_customuser_user_type.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.0.6 on 2024-07-04 09:39 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('accounts', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='customuser', 15 | name='name', 16 | ), 17 | migrations.AddField( 18 | model_name='customuser', 19 | name='user_type', 20 | field=models.CharField(choices=[('admin', 'Admin'), ('editor', 'Editor'), ('viewer', 'Viewer')], default='admin', max_length=10), 21 | preserve_default=False, 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week-8/backend/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import AbstractUser 2 | from django.db import models 3 | 4 | 5 | class CustomUser(AbstractUser): 6 | 7 | USER_TYPE_CHOICES = ( 8 | ('admin', 'Admin'), 9 | ('editor', 'Editor'), 10 | ('viewer', 'Viewer'), 11 | ) 12 | 13 | user_type = models.CharField(max_length=10, choices=USER_TYPE_CHOICES) 14 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/accounts/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week-8/backend/db.sqlite3 -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/django_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week-8/backend/django_project/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/django_project/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for django_project project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/django_project/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for django_project project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week-8/backend/posts/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Post 3 | 4 | admin.site.register(Post) 5 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class PostsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'posts' 7 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phitronio/Conceptual-Sessions-Code/b624d37703560c37bfe7b644e0a065a8e2a2e88d/Batch-4/Django/Week-8/backend/posts/migrations/__init__.py -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/models.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from django.db import models 3 | 4 | class Post(models.Model): 5 | 6 | 7 | 8 | title = models.CharField(max_length=50) 9 | body = models.TextField() 10 | author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) 11 | created_at = models.DateTimeField(auto_now_add=True) 12 | updated_at = models.DateTimeField(auto_now=True) 13 | 14 | 15 | def __str__(self): 16 | return self.title 17 | 18 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import Post 3 | 4 | class PostSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = Post 7 | fields = ["id","author","title","body","created_at"] 8 | read_only_fields = ["author",] 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Batch-4/Django/Week-8/backend/posts/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from .views import PostList, PostDetail 3 | 4 | urlpatterns = [ 5 | path("", PostList.as_view(), name="post_list"), 6 | path("/", PostDetail.as_view(), name="post_detail"), 7 | ] 8 | -------------------------------------------------------------------------------- /Batch-4/OOP/Week 2-1/multilevel_inheritance.py: -------------------------------------------------------------------------------- 1 | class Vehicle: 2 | def __init__(self, brand, model): 3 | self.brand = brand 4 | self.model = model 5 | 6 | def spedd(self): 7 | pass 8 | 9 | class Car(Vehicle): 10 | def __init__(self, brand, model, capacity): 11 | super().__init__(brand, model) 12 | self.capacity = capacity 13 | 14 | class ElectricCar(Car): 15 | def __init__(self, brand, model, capacity, battery_capacity): 16 | super().__init__(brand, model, capacity) 17 | self.battery_capacity = battery_capacity 18 | 19 | 20 | tesla = ElectricCar("Tesla", "X8", 7, 100000000) 21 | print(tesla.battery_capacity) -------------------------------------------------------------------------------- /Batch-4/OOP/Week 2-2/0_index.txt: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------