theRangeCoder / data-structures-and-algorithms

This repository contains my solutions to various data structures and algorithms problems, spread across varying levels of difficulty (easy, medium, hard), to prepare myself thoroughly for cracking the coding interviews!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data Structures and Algorithms!

This repository contains my solutions to various data structures and algorithms problems, spread across varying levels of difficulty (easy, medium, hard), to prepare myself thoroughly for cracking the coding interviews!

Difficulty level: Easy

Sl. No. Problem description Topic My code (solution) Remarks
1 You are given a String str. Return the String by Concatenating it with String "Hello, " and an exclamation mark at the end “!” Strings My code
2 You are given two integers, a and b. Compute the Sum and Difference of a and b. Return the Product of Sum and Difference Math My code
3 You are given two integers, a and b. Let x be the integer division and y be the decimal(float) division of a and b. Return the product of x and y Math My code
4 Given an array arr of size n, and two intervals x and y. Find the average of elements which lies between the given intervals inclusively Arrays My code
5 Given a string str1, Return the array containing the frequency of each character in the order of their occurrence Arrays My code
6 Given a Positive Integer n, return an array of string containing the palindromic string of intergers i.e. 1, 121, 12321, 1234321, 123454321 for n = 5 Math My code
7 Given an arr of size n. Return the second largest element Arrays My code
8 The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, F(0) = 0, F(1) = 1 and F(n) = F(n - 1) + F(n - 2), for n > 1. Given n, calculate F(n) Math My code
9 The factorial of a positive integer n is the product of all positive integers less than or equal to n. You’re given a number and you have to calculate it’s factorial using the recursive approach. Note: Factorial of 1 = 1, Factorial of 0 = 1 Math My code
10 Given an integer n , return 1(true) if it is a power of two else return 0(false). An integer x is said to be in power of two if and only if there exists an integer i such that 2i == x Math My code
11 Given an integer array 'nums’, return 1(true) if any value appears at least twice in the array, and return 0(false) if every element is distinct Arrays My code
12

Difficulty level: Medium

Sl. No. Problem description Topic My code (solution) Remarks
1

Difficulty level: Hard

Sl. No. Problem description Topic My code (solution) Remarks
1

About

This repository contains my solutions to various data structures and algorithms problems, spread across varying levels of difficulty (easy, medium, hard), to prepare myself thoroughly for cracking the coding interviews!


Languages

Language:Python 100.0%