Git Product home page Git Product logo

cpp's People

Contributors

abhi-3027 avatar ac-boss avatar adarsh150999 avatar agvidit1 avatar akshitagupta15june avatar aliex-dev avatar altctrldel1999 avatar ayush523 avatar bvishal8510 avatar d2anubis avatar deytulsi18 avatar harshadchovatiya avatar ifroghop2worlds avatar kothawade29 avatar mahimagoyalx avatar mallick370 avatar pawarhrishi21 avatar piyush9311 avatar pranjalibajpai avatar priyanshu-bisht-05 avatar sachinsom93 avatar samarth-asthana avatar sharannyobasu avatar shibrahmachari avatar shubhamjagtap2000 avatar siddharthav19 avatar srihari039 avatar sujalgera01 avatar vaibhavmishra-svg avatar vyomgarg47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp's Issues

Create Pascal pattern

Given an integer N, print Pascal Triangle upto N rows.
Input Format

Single integer N.
Constraints

N <= 10
Output Format

Print pascal triangle.
Sample Input

4

Sample Output

       1
     1   1
   1   2   1
 1   3   3   1

DECIMAL TO OCTAL

Take N (number in decimal format). Write a function that converts it to octal format. Print the value returned.
Input Format

Constraints

0 < N <= 1000000000
Output Format

Sample Input

63

Sample Output

77

Unique Number II

I would like to take this issue as a part of hactoberfest. Please assign me.

String Compression

Take as input S, a string. Write a function that does basic string compression. Print the value returned. E.g. for input “aaabbccds” print out a3b2c2d1s1.
Input Format

A single String S
Constraints

1 < = length of String < = 1000
Output Format

The compressed String.
Sample Input

aaabbccds

Sample Output

a3b2c2d1s1

Explanation

In the given sample test case 'a' is repeated 3 times consecutively, 'b' is repeated twice, 'c' is repeated twice and 'd and 's' occurred only once.

FIND HCF

Given N positive numbers, your task is to calculate their HCF.
Input Format

First line of input contains a single integer N, second line contains N space separated positive integers whose HCF is to be computed.
Constraints

N <= 10 and all the numbers lie between 1 and 100.
Output Format

Print HCF of N numbers.
Sample Input

3
2 4 6

Sample Output

2

Choose Numbers

You are given an array of integers A.
You need to tell whether you can choose three numbers such that a+b>=c.

Input Format
First line consists of number of integers N. next line consists of N space separated integers.

Constraints
1 <= N <= 10^5

Output Format
YES or NO

Sample Input
5
1 2 3 4 9
Sample Output
YES
Explanation
you can choose 1+3 >= 4

Solve the question and raise the Pull Requests.

Implement merge sort

Merge sort is missing in the sorting section, I would like to add it as a part of Hacktoberfest.

Add the algorithms!!

Add the algorithms if you find they are not already added in the repositories and create a pull request.

Example :
In sorting/searching repo many algos are not added so add them and raise the pull request.

  • you can create issue on codes if you find any mistakes in them.

Happy Coding!!!

Can you solve this pattern??

Take N as input. For a value of N=5, we wish to draw the following pattern :

                      5 4 3 2 1 0 1 2 3 4 5
                        4 3 2 1 0 1 2 3 4 
                          3 2 1 0 1 2 3 
                            2 1 0 1 2 
                              1 0 1 
                                0 
                              1 0 1 
                            2 1 0 1 2 
                          3 2 1 0 1 2 3 
                        4 3 2 1 0 1 2 3 4 
                      5 4 3 2 1 0 1 2 3 4 5

Input Format

Take N as input.
Constraints

N <= 20
Output Format

Pattern should be printed with a space between every two values.
Sample Input

5

Find Sum-Trees

Given a balanced binary tree find sum of all the nodes.
Input Format

First line contains N the number of elements in the tree. Next line contains N space separated elements.
Constraints

0 <= N <= 10^6

-10^7 <= tree.data <= 10^7
Output Format

A single integer : Sum of the tree
Sample Input

3
1 2 3

Sample Output

6

Largest Subset

Given an array A1, A2 . . . AN what is the size of the largest subset of the array such that the each pair of elements in the subset is coprime.
Input Format

The first line contains an integer N, followed by N numbers in the next line.
Constraints

N<=50 , Ai<=50
Output Format

Output is a single number denoting the size.
Sample Input

5
2 3 2 3 2

Sample Output

2

Create XOR MATRIX

You are given a matrix A of size nxm. Find any suitable integer sequence C of size n such that A[1][c[1]]^A[2][c[2]]^….^A[n][c[n]] is greater than 0. Output Format : IF there is no solution , just print “NIE” , otherwise first print “TAK” and then print configuration.
Input Format

Given a matrix of A of size (n X m)
Constraints

n, m<=500, A[i][j]<1024
Output Format

If there is no solution , just print “NIE” , otherwise first print “TAK” and then print configuration.
Sample Input

3 2
0 0
0 0
0 0

Sample Output

NIE

Create Tree Top View

Given a binary tree , print the nodes in left to right manner as visible from above the tree
Input Format

Level order input for the binary tree will be given.
Constraints

No of nodes in the tree can be less than or equal to 10^7
Output Format

A single line containing space separated integers representing the top view of the tree
Sample Input

1 2 3 4 5 6 -1 -1 -1 -1 -1 -1 -1

Sample Output

4 2 1 3

Explanation

The tree looks like

             1
          /      \
       2           3
    /     \       /
   4       5     6

When viewed from the top , we would see the nodes 4, 2, 1 and 3.

Bubble Sort

solve the issue using CPP.
provide
codes/algos

Is String a Palindrome?

Write a C++ program to check if a given string of lower case alphabets ('a' to 'z') is a palindrome.

0-1Knapsack

You are packing for a vacation on the sea side and you are going to carry only one bag with capacity S (1 <= S <= 1000). You also have N (1<= N <= 1000) items that you might want to take with you to the sea side. Unfortunately you can not fit all of them in the knapsack so you will have to choose. For each item you are given its size and its value. You want to maximize the total value of all the items you are going to bring. What is this maximum total value?
Input Format

On the first line you are given N and S.
Second line contains N space separated integer where ith integer denotes the size of ith item. Third line contains N space seperated integers where ith integer denotes the value of ith item.
Constraints

1 <= S,N <= 1000
Output Format

Output a single integer showing the maximum value that can be obtained by optimally choosing the items.
Sample Input

5 4
1 2 3 2 2
8 4 0 5 3

Sample Output

13

Explanation

Total capacity = 4.
Pick size 1 with value 8 and size 2 with value 5.

PROCESS OF CONTRIBUTION IN THIS REPOSITORY

PROCESS OF CONTRIBUTION IN THIS REPOSITORY

STAR THIS REPO
FORK THIS REPOSITORY
ADD YOUR CODE IN RESPECTIVE FOLDER
CREATE A PULL REQUEST
AFTER A SIMPLE CHECK I WILL MERGE THE PR

HAPPY CODING AND CONTRIBUTING!!!!

Soduku Solver

I would like to take this issue as a part of hactoberfest.

RAISE ANY ISSUE OF YOUR CHOICE RELATED TO CPP.

RAISE ANY ISSUE OF YOUR CHOICE.
Members who will be willing to contribute can raise Pull Requests and they will be merged.
Happy Coding!

PROCESS OF CONTRIBUTION IN THIS REPOSITORY

FORK THIS REPOSITORY
ADD YOUR CODE IN RESPECTIVE FOLDER
CREATE A PULL REQUEST
AFTER A SIMPLE CHECK I WILL MERGE THE PR

HAPPY CODING AND CONTRIBUTING!!!!

Strings-Remove Duplicates

Take as input S, a string. Write a function that removes all consecutive duplicates. Print the value returned.
Input Format

String
Constraints

A string of length between 1 to 1000
Output Format

String
Sample Input

aabccba

Sample Output

abcba

Explanation

For the given example, "aabccba", Consecutive Occurrence of a is 2, b is 1, and c is 2.

After removing all of the consecutive occurences, the Final ans will be : - "abcba".

Euclid Algorithm

I would like to take this issue as a part of hactoberfest. Please assign me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.