husnasari / algorithms Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Write the program that gives the following output
*
**
***
..
****.. * (N pieces)
..
***
**
*
Note :
Example 1:
N : 4
*
**
***
****
***
**
*
Example 2:
N: 3
*
**
***
**
*
Difficulty: 10/3
For example :
Input : {1, 5, 3, 0, 2, 0 ,10, 0, 9, 8}
Output : {0, 0, 0, 1, 5, 3, 2, 10, 9, 8 }
Difficulty: 10/5
Write a program that gives a binary number depends on a N column.
Example Binary Table (2 columns):
0 0
0 1
1 0
1 1
For example:
N : 3
Output :
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
For example :
N : 5
Output :
0 0 0 0 0
0 0 0 0 1
0 0 0 1 0
0 0 0 1 1
0 0 1 0 0
..
1 1 1 1 1
Difficulty : 10/4
Read a sentence from console and find which character is maximum repeating character.
Example 1:
Hello world
Frequency: 3, character: L
Example 2:
Ben en çok seni severim.
Frequency: 5, character: e
Read a word or a sentence and 2 character from console.
First character is the searched character,
Second character is the replacement of the searched.
Print changed sentence to console.
Example 1 :
Sentence : Change me please.
Searched : e
Replacement : u
Output : Changu mu pluasu.
Example 2 :
Sentence : Yamette kudasai!
Searched : t
Replacement : d
Output: Yamedde kudasai!
Read a sentence and a word from console and search the word in the sentence.
Example 1 :
Sentence : Search me please
Word: me
Output: "me" word is exist on 7-9 indexes of the sentence.
Example 2 :
Sentence : I am starving now!
Word : hungry
Output : "hungry" word is not exist on the sentence!
Read a number from console and check is prime number or not with a recursive function.
Example prime numbers:
2, 3, 5, 7, 11, 13, 17
Example :
N : 23
Output : 23 is a prime number!
N : 32
Output : 32 is not a prime number..
N : 17
Output : 17 is a prime number!
Difficulty : 10/5
Write a program that gives a half pyramid of increasing numbers.
Example 1 :
N : 4
Output :
1 (row 1)
2 3 (row : 2)
4 5 6 (row : 3)
7 8 9 10 (row : 4)
Example 2 :
N : 6
Output :
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
Difficulty: 10/5
Reverse the number read from the console and print it on the screen as output.
Note : Please don't use recursive functions.
For example :
number : 124
output : 421
number : 51224
output : 42215
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.