- 재귀, 공재귀, 꼬리 재귀 함수의 구현 방법을 알아본다.
- TCE를 사용해 꼬리 재귀 호출을 최적화한다.
- 람다를 재귀적으로 만든다.
- memorization을 적용해 계산 속도를 높인다.
- 재귀(recursive) : 마지막 단계부터 계산을 시작한다.
fun main() { | |
while (true) { | |
val r = readLine()?.replace(",", "','") | |
var result = "[" | |
result += r?.split(" ")?.joinToString("") {"{'$it'}, "} | |
result = result.dropLast(2) + "]" | |
println(result.replace("','", "', '")) | |
} | |
} |
package com.example.ttsplayer; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.speech.tts.TextToSpeech; | |
import android.speech.tts.UtteranceProgressListener; | |
import android.text.Spannable; | |
import android.text.SpannableString; | |
import android.text.style.BackgroundColorSpan; | |
import android.view.View; |
public class Register { | |
private Integer r1 = null; | |
private Integer r2 = null; | |
public Integer getR1() { | |
return r1; | |
} | |
public void setR1(Integer r1) { | |
this.r1 = r1; |
public class Adder { | |
public boolean[] byteadder(boolean[] byteA, boolean[] byteB) { | |
boolean[] answer = new boolean[9]; | |
boolean carry = false; | |
for (int i = 0; i < answer.length - 1; i++) { | |
boolean[] value = fulladder(byteA[i], byteB[i], carry); | |
answer[i] = value[1]; | |
carry = value[0]; |
import kotlin.experimental.and | |
object EndianConverter { | |
fun printConvertResult(testValue: Array<Long>) { | |
for (number in testValue) { | |
println("Input Value : 0x${Integer.toHexString(number.toInt())}") | |
val littleEndianArray = convertEndianSystem(number) | |
val littleEndianIntValue = bytesToInt(littleEndianArray) |
package project; | |
public class Area { | |
private int num; // 지역 번호 | |
private int x; // 중심의 x 좌표 | |
private int y; // 중심의 y 좌표 | |
private int radius; // 반지름 | |
private enum Location { | |
ANOTHER_LOCATION, INSIDE, OUTSIDE |
다음 수업(3.28)부터는 Python 교육이 시작됩니다.
수업 당일 날 설치를 진행하면 시간이 많이 지체되기 때문에 아래 가이드에 따라 미리 파이썬을 설치해주세요.
설치 링크에서 Download Python 3.7.2 클릭