算法存档:我的算法存档用于工程管理

时间:2021-02-22 08:53:31
【文件属性】:
文件名称:算法存档:我的算法存档用于工程管理
文件大小:59KB
文件格式:ZIP
更新时间:2021-02-22 08:53:31
Ruby 算法档案 这是我的个人算法档案,也是我存储算法研究的地方,旨在为我在工程管理过程中提供更好的采访开发人员资源。 演算法 回溯 回溯是解决算法问题的有效技术。 在回溯中,我们执行深度优先搜索解决方案,一旦遇到死胡同,就会跳回到最后一条有效路径。 回溯的好处是,如果正确实施,可以保证找到解决方案(如果存在)。 此外,该解决方案将比蛮力解决方案探索更为有效,因为我们淘汰了已知无效的路径(称为修剪)。 另一方面,回溯不能保证我们将找到最佳解决方案,如果要求我们在N个步骤的每一个中选择M条路径中的一条,回溯通常会导致阶乘或指数时间复杂性。 为了确定回溯是否是用于问题的正确算法,需要提出三个核心问题。 您可以构建部分解决方案吗? 您可以验证部分解决方案是否无效吗? 您可以验证解决方案是否完整吗? 为了说明这一概念,我们将逐步介绍最常见的回溯示例之一:N皇后难题。 在此问题中,将为您提供N
【文件预览】:
algorithms-archives-main
----binary_tree()
--------symmetric_tree.rb(3KB)
--------maximum_depth_of_binary_tree.rb(5KB)
----linked_lists()
--------linked_list_circle.rb(4KB)
--------remove_nth_node_from_end_of_list.rb(3KB)
--------linked_list_detect_cycle.rb(5KB)
--------reverse_linked_list.rb(1KB)
--------intersection_of_two_linked_lists.rb(4KB)
--------remove_linked_list_elements.rb(1KB)
----arrays()
--------valid_mountain_array.rb(1KB)
--------single_number.rb(3KB)
--------intersection_of_two_arrays_ii.rb(2KB)
--------merge_sorted_arrays.rb(2KB)
--------remove_duplicates_from_sorted_array.rb(2KB)
--------get_products_of_all_other_elements.rb(4KB)
--------missing_number.rb(7KB)
--------maximum_consecutive_ones_ii.rb(4KB)
--------plus_one.rb(2KB)
--------height_checker.rb(1KB)
--------implement_strstr.rb(4KB)
--------two_sum_ii.rb(1021B)
--------find_all_numbers_disappeared_in_an_array.rb(3KB)
--------third_maximum_number.rb(6KB)
--------in-place-algorithms()
--------check_if_n_and_its_double_exist.rb(901B)
--------duplicate_zeros.rb(2KB)
--------squares_of_a_sorted_array.rb(2KB)
--------remove_element.rb(3KB)
--------contains_duplicates.rb(3KB)
--------rotate_image.rb(1KB)
--------two_sum.rb(4KB)
----recursion()
--------swap_nodes_in_pairs.rb(2KB)
--------reverse_string.rb(2KB)
----README.md(15KB)
----binary_search()
--------binary_search_template_3.rb(1KB)
--------binary_search_template_2.rb(1KB)
--------sqrtx.rb(2KB)
--------valid_perfect_square.rb(2KB)
--------binary_search_template_1.rb(2KB)
----strings()
--------array_strings_are_equal.rb(542B)
--------reverse_integer.rb(1KB)
--------first_unique_character_in_a_string.rb(2KB)
----searching()
--------linear-search()

网友评论