본문 바로가기 메뉴 바로가기

Studying programming

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Studying programming

검색하기 폼
  • Jimin's Programming (194)
    • Algorithms (54)
    • JavaScript (16)
    • Vue.js (3)
    • Node.js (3)
    • React.js (7)
    • React Native (0)
    • Spring Boot (13)
    • JAVA (58)
    • C++ (17)
    • Programming (19)
    • Computer basics (4)
  • 방명록

algorithm (11)
Staircase

Problem Observe that its base and height are both equal to n, and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces. Write a program that prints a staircase of size n. Solution function staircase(n) { for (let i = 1; i

Algorithms 2020. 8. 4. 20:00
Plus Minus

Question Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal. 주어진 Array안에서 negative value, positive value 그리고 0 의 수가 array크기에 얼마나 비례하는지 소수점 6자리까지 프린트하는 문제. Example output 0.400000 0.400000 0.200000 Solution let arr = [1, 1, 0, -1, -1]; function diagonalDiffer..

Algorithms 2020. 7. 29. 01:33
Diagonal Difference in JavaScript

Question Given a square matrix, calculate the absolute difference between the sums of its diagonals. 2d array 의 서로 다른 두 개의 대각선 값의 Absolute difference 즉, 절대값을 결과로 보여주는 문제. For example, 1 2 3 4 5 6 9 8 9 (1 + 5 + 9) - (3 + 5+ 9) |15 - 17| the absolute difference is 2. Tip. 0 1 2 0 o x o 1 x o x 2 o x o 필요한 부분이 나오는 배열의 형태를 먼저 적어주고 그 형태가 나올 수 있는 loop의 형태를 고민해 본다. 2d Array는 loop를 적용시키면 Column(세로) 이 순..

Algorithms 2020. 7. 27. 23:38
Sequential Search Algorithm (Linear Search)

Sequential Search Algorithm (Linear Search) 순차탐색 Less used than binary search and Hash Table. Big-O notation for Sequential Search is O(n) which is relatively slower than others. public class Main { public static void main(String[] args) { int arr[] = {7, 4, 3, 1, 5}; int x = 3; int answer = linearSearch(arr, x); if(answer == -1){ System.out.println("No element matched"); }else{ System.out.print..

Algorithms 2019. 7. 30. 06:02
Algorithm & Data structure

Algorithm & Data structure What are Algorithms and Data structures? The data structure is those different ways of storing data on your program. e.g. Array, List, Stack, Queue, Tree, Hash etc, The algorithm is operations on different data structures + sets of instructions for executing them. e.g. Sort, Search, Max, Min etc, Let's see the image to get a concrete example. We can see alphabet A to E..

Programming 2019. 1. 20. 17:45
이전 1 2 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • hackerrank solution
  • algorithm
  • repeat()
  • java
  • ... in Javascript
  • Collection Framework
  • Javascript Algorithm
  • easy algorithm
  • hackerrank javascript solution
  • compareTo()
  • rest parameter
  • javascript
  • math.max
  • spring boot application
  • HackerRank Algorithm
  • easy javascript algorithm
  • 프로그래머스
  • string class in java
  • 프로그래머스 알고리즘문제
  • substring()
  • math.abs
  • 프로그래머스 알고리즘
  • C++
  • 알고리즘
  • code refactoring
  • equals()
  • HashMap
  • Object type casting
  • hackerrank javascript
  • hackerrank
more
«   2025/09   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바