Skip to content

Instantly share code, notes, and snippets.

View sumukus's full-sized avatar

Suraj Mukhia sumukus

View GitHub Profile
@sumukus
sumukus / binarySearch.py
Created May 5, 2019 14:49
Search Algorithms
def binarySearch(data,search):
while len(data) > 1:
mid=len(data)//2
if data[mid] is search:
return True
elif data[mid] > search:
return binarySearch(data[:mid],search)
else:
return binarySearch(data[mid:],search)
if len(data) is 1:
@sumukus
sumukus / gcit.cpp
Created September 11, 2019 10:54
This will contain the c++ programming code
#include<iostream>
@sumukus
sumukus / arraySort.cpp
Last active September 12, 2019 07:43
This is script file containing the c++ program code
#include<iostream>
using namespace std;
int sortArray(int[],int);
int main(){
int mark[]={9,3,5,6,1,5,4,7,1};
int size=sizeof(mark)/sizeof(int);
sortArray(mark,size);
return 0;
}
@sumukus
sumukus / charCount.c
Last active September 14, 2019 12:48
This file contains some basic C programming code
#include<stdio.h>
/* do while loop and break statement used to
count the number of character in the string */
int main(){
char str[]="Grettings";
int count=0;
do{
if(str[count]=='\0'){
printf("There are %d characters in total\n",count);
break;
@sumukus
sumukus / ConnectionDemo.java
Last active May 19, 2020 16:26
It is a java program code to connect to MariaDB database in Ubuntu Operating system using the Connector/J JDBC
import java.sql.*;
public class ConnectionDemo {
public static void main(String[] arg){
//Declaring the variables
Connection con = null;
Statement stm = null;