csemod 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csemod
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Personal Project - Education Purpose Only
5
5
  Author: BonzoDon
6
6
  License: CC0-1.0
@@ -1808,6 +1808,55 @@ int main() {
1808
1808
  }
1809
1809
  """
1810
1810
 
1811
+ # Binary Search Program (C++)
1812
+ binary_search = """
1813
+ #include <iostream>
1814
+ using namespace std;
1815
+
1816
+ int main() {
1817
+ int arr[100];
1818
+ int size, key;
1819
+ int low, high, mid;
1820
+ bool found = false;
1821
+
1822
+ cout << "Enter size of array: ";
1823
+ cin >> size;
1824
+
1825
+ cout << "Enter elements in sorted order: " << endl;
1826
+ for (int i = 0; i < size; i++) {
1827
+ cin >> arr[i];
1828
+ }
1829
+
1830
+ cout << "Enter element to search: ";
1831
+ cin >> key;
1832
+
1833
+ low = 0;
1834
+ high = size - 1;
1835
+
1836
+ while (low <= high) {
1837
+ mid = (low + high) / 2;
1838
+
1839
+ if (arr[mid] == key) {
1840
+ cout << "Element found at position: " << mid << endl;
1841
+ found = true;
1842
+ break;
1843
+ }
1844
+ else if (arr[mid] < key) {
1845
+ low = mid + 1;
1846
+ }
1847
+ else {
1848
+ high = mid - 1;
1849
+ }
1850
+ }
1851
+
1852
+ if (!found) {
1853
+ cout << "Element not found." << endl;
1854
+ }
1855
+
1856
+ return 0;
1857
+ }
1858
+ """
1859
+
1811
1860
 
1812
1861
  answer_dict = {
1813
1862
  "insertelement": insert_element,
@@ -1820,6 +1869,7 @@ answer_dict = {
1820
1869
  "linearqueue": linear_queue,
1821
1870
  "circularqueue": circular_queue,
1822
1871
  "priorityqueue": prioriy_queue,
1872
+ "binarysearch": binary_search,
1823
1873
  "linkedlist": linked_list,
1824
1874
  "grade": prog1_grade,
1825
1875
  "factors": prog2_factors,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csemod
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Personal Project - Education Purpose Only
5
5
  Author: BonzoDon
6
6
  License: CC0-1.0
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = csemod
3
- version = 0.0.3
3
+ version = 0.0.4
4
4
  description = Personal Project - Education Purpose Only
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -8,7 +8,7 @@ def get_long_description(path):
8
8
 
9
9
  setup(
10
10
  name='csemod',
11
- version='0.0.3',
11
+ version='0.0.4',
12
12
  description="Personal Project - Education Purpose Only",
13
13
  license="CC0-1.0",
14
14
  long_description=get_long_description('README.md'),
File without changes
File without changes
File without changes