0% found this document useful (0 votes)
6 views93 pages

2 Recursion Jarray Jpointer

The document outlines a syllabus for a data structures and algorithms course taught by Prof. Inhwan Kim, covering topics such as arrays, structures, pointers, and recursion. It includes details on algorithm analysis, time complexity, and applications of data structures, particularly in polynomial operations. The course emphasizes the importance of data structures and algorithms in creating efficient and scalable solutions in technology.

Uploaded by

rifatbinayub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views93 pages

2 Recursion Jarray Jpointer

The document outlines a syllabus for a data structures and algorithms course taught by Prof. Inhwan Kim, covering topics such as arrays, structures, pointers, and recursion. It includes details on algorithm analysis, time complexity, and applications of data structures, particularly in polynomial operations. The course emphasizes the importance of data structures and algorithms in creating efficient and scalable solutions in technology.

Uploaded by

rifatbinayub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 93

Array, Structure, Pointer, Recursion

(Week2)

Prof. Inhwan Kim

[email protected]
LMS Mail
010-2329-8055
Attendance Check
Syllabus

1st week Data Structure & Algorithm Overview

2nd week Array, Structure, Pointer, Recursion

3rd week Stack

4th week Queue

5th week Linked List (1)

6th week Linked List (2)

7th week Tree (1)

8th week Midterm

9th week Tree (1) – Priority Queue

10th week Graph (1)

11th week Graph (2)

12th week Sorting

13th week Searching

14th week Hashing

15th week Final Exam


(Review)
Algorithm Analysis
Algorithm Analysis

How to analyze an Algorithm

1. Time

2. Space

3. Network

4. Power

5. CPU Registers
Algorithm Analysis

Time Complexity

Algorithm Swap(a,b)

temp = a; 1

a = b; 1

b = temp; 1

}
F(n) = 3

O(1) : Order of 1
Algorithm Analysis

Time Complexity
Algorithm sum(A, n)

S = 0; 1

for (i=0; i<n; i++) n+1

S = S + A[i]; n

return s; 1

} F(n) = 2n + 3
O(n)
Algorithm Analysis

Time Complexity nxn

Algorithm add (A, B, n)

for (i=0; i<n; i++) n+1

for ( j=0; j<n; j++) n x (n+1) = n2 + n

C[i,j] = A[i,j] + B[i,j]; n x n = n2

} F(n) = 2n2 + 2n + 1

} O(n2)
Algorithm Analysis

Types of Time function (Big O Notation)

O(1) Constant f(n) =2, f(n) =5, f(n) =20000


O(logN) Logarithmic binary search
O(n) Linear f(n) =2n+3, f(n) =5000n+70000
O(n2) Quadratic
O(n3) Cubic
O(2n) Exponential

Go to YouTube
“binary search Big O notation”
Algorithm Analysis

Big O Notation

Run time

number of inputs
Why Data Structure and Algorithm?

Data Structures and Algorithms allow us to build efficient, scalable, and


resource-optimal solutions that are crucial in both academic and real-world
applications. Whether it's handling vast amounts of data, optimizing code, or
solving complex problems, DSA lays the groundwork for success in various
fields of technology.

• Efficient Problem Solving


• Optimizing Resources
• Scalability확장성
• Foundation for Advanced Concepts
• Improved Coding Skills
• Real-World Applications
2nd week : Array, Structure, Pointer, Recursion

01 Array
02 Structure
03 Applications of Array and Structure
04 Pointer
05 Recursion
ADT(Abstract Data Type)
ADT

ADT (Abstract추상적인 Data Type)


Definition: - A set of data values and associated operations that are precisely
specified independent of any particular implementation

- Define data abstractly and mathematically


- Definition of objects and functions in ADT (::= means as defined)

- Abstract data types: commonly abbreviated ADTs,


• are a way of classifying data structures
• based on how they are used and the behaviors they provide.
• do not specify how the data structure must be implemented
or laid out in memory,
• but simply provide a minimal expected interface and set of behaviors.

Ex) Stack: an abstract data type that specifies


a linear data structure(object) with LIFO behavior(function).
commonly implemented using arrays or linked lists.
02. Array
Basics of Data structure

□ Classification of data structures

Data Structure

Simple Structure Linear Structure Non-Linear Structure

Integer Array Tree


Singly

Float (real #) Linked List Doubly General

Circular Binary
Character Stack

Character string Queue Graph

Directed

Undirected
Basics of Data structure and Algorithm

Types of Data Structure

17
Array

Array

- Used to create multiple variables of the same type

- int list1, list2, list3, list4, list5, list6;


→ int list[6];

Array Element

Array Index
Array

ADT(Abstract Data Type) Array

- Object : <index, value>

- Operation
· create(size) ::= Create an array that can hold “size” elements
· get(A,i) ::= Returns the ith element of array A
· set(A,I,v) ::= store value v at ith position in array A

Element

index
ADT

ADT (Abstract추상적인 Data Type)


Definition: A set of data values and associated operations that are precisely
specified independent of any particular implementation

- Define data abstractly and mathematically


- Definition of objects and functions in ADT (::= means as defined)

- Abstract data types: commonly abbreviated ADTs,


are a way of classifying data structures
based on how they are used and the behaviors they provide.
do not specify how the data structure must be implemented
or laid out in memory,
but simply provide a minimal expected interface and set of behaviors.

Ex) Stack: an abstract data type that specifies


a linear data structure(object) with LIFO behavior(function).
commonly implemented using arrays or linked lists.
Array
□ Array
A data group created by arranging data of the same data type
in order and storing them consecutively in memory

[ array - C Language ] [ list – Python ]


A = [2,4,0,5]

2 4 0 5
Int A[4] = {2,4,0,5};
A
A[0] A[1] A[2] A[3] A[0] A[1] A[2] A[3]

A 2 4 0 5
A.append(6) : Insert 6 at the very end
A.pop() : Clear the top value and return
A[2] = A[2] +1;
A.pop(1) : Remove A[1] and return
A.insert(1,10) : Insert 10 into A[1]
※ A[2] address
A.remove(value) : Remove “value” from A
: A[0] address + 2*4Bytes
A.index(value), A.count(value), …

※ List in Python automatically adjust their


capacity
Array

□ 1-Dimensional Array1차원배열

int list[6]; // define object & create operation


list[0] = 100; // set operation
value = list[0]; // get operation
Array
□ 2-Dimensional Array

int list[3][5];

Column 0 Column 1 Column 2 Column 3 Column 4

Row 0

Row 1

Row 2
Structure
Structure

Structure

Structure : group data of different types together

Array : group data of the same type

Array Structure

Field
Structure

Examples of using structure in C :

Declaring a structure and creating a structure variable (ADT)


Data Structure:
struct studentTag {
char name[10]; // name as character array
int age; // Integer value representing age
double gpa; // Real value representing the average score
};

operations:
struct studentTag s1;

strcpy(s1.name, “Soares");
s1.age = 20;
s1.gpa = 4.3;
Structure

typedef

typedef studentTag {
char name[10];
int age;
double gpa;
} student;

student s;

student s = { “Soares", 20, 4.3 };


Structure

Example Install Embarcadero Dev C++

#include <stdio.h>

typedef struct studentTag {


char name[10];
int age;
double gpa;
} student;

int main(void)
{
student a = { “Soares", 20, 4.3 };
student b = { “Nazarova", 21, 4.2 };
return 0;
}
Applications of Arrays and Structures
Applications of Array and Structure : polynomial

General form of polynomials "p of x equals a sub n times x to the power of n, plus a sub
n minus 1 times x to the power of n minus 1, plus ……..,
plus a sub 1 times x, plus a sub 0."

p( x) = an x n + an−1 x n−1 + ... + a1 x + a0


It need a data structure for the polynomials in order to handle
polynomials in the program

→ Which data structure should be used to make polynomial addition,


subtraction, multiplication, and division operations
conveniently and efficiently?
Applications of Array and Structure : polynomial

Two ways to use arrays to represent polynomials


(1)Storing all terms of a polynomial in array

(2)Storing only nonzero terms of polynomials in array


Applications of Array and Structure : polynomial

To express polynomials #1

- Storing coefficient values for all orders as an array

- One polynomial expressed as one array

10 x 5 + 0 x 4 + 0 x 3 + 0 x 2 + 6 x1 + 3 x 0
1
0 1 2 3 4 5 6 7 8 9
0

coef 10 0 0 0 6 3
Applications of Array and Structure : polynomial

To express polynomials #1

#define MAX_DEGREE 101 // Maximum degree of polynomial + 1


typedef struct { // struct
int degree;
float coef[MAX_DEGREE]; // array
} polynomial;
polynomial a = { 5, {10, 0, 0, 0, 6, 3} };
Applications of Array and Structure : polynomial
To express polynomials #1 (practice)
// C = A+B A, B are polynomial. Return structure
polynomial poly_add1(polynomial A, polynomial B)
{
polynomial C; // result
int Apos = 0, Bpos = 0, Cpos = 0; // Variable of index
int degree_a = A.degree;
int degree_b = B.degree;
C.degree = MAX(A.degree, B.degree); // The degree of result

while (Apos <= A.degree && Bpos <= B.degree) {


if (degree_a > degree_b) { // A > B
C.coef[Cpos++] = A.coef[Apos++];
degree_a--;
}
else if (degree_a == degree_b) { // A == B
C.coef[Cpos++] = A.coef[Apos++] + B.coef[Bpos++];
degree_a--; degree_b--;
}
else { // B > A
C.coef[Cpos++] = B.coef[Bpos++];
degree_b--;
}
}
return C;
}
Applications of Array and Structure : polynomial

To express polynomials #1
void print_poly(polynomial p)
{
for (int i = p.degree; i>0; i--)
printf("%3.1fx^%d + ", p.coef[p.degree - i], i);
printf("%3.1f \n", p.coef[p.degree]);
}

// Main function
int main(void)
{
polynomial a = { 5,{ 3, 6, 0, 0, 0, 10 } };
polynomial b = { 4,{ 7, 0, 5, 0, 1 } };
polynomial c;
print_poly(a);
print_poly(b);
c = poly_add1(a, b);
printf(“-----------------------------------------------------------------------------\n”);
print_poly(c);
return 0;
}
Applications of Array and Structure : polynomial

Execution result

3.0x^5 + 6.0x^4 + 0.0x^3 + 0.0x^2 + 0.0x^1 + 10.0


7.0x^4 + 0.0x^3 + 5.0x^2 + 0.0x^1 + 1.0
-----------------------------------------------------------------------------
3.0x^5 + 13.0x^4 + 0.0x^3 + 5.0x^2 + 0.0x^1 + 11.0
Polynomial in Python
# Define a class to represent a polynomial
class Polynomial:
def __init__(self, degree, coef):
self.degree = degree
# Initialize the coefficient list with the provided coefficients.
# If the list is shorter than MAX_DEGREE, pad it with zeros.
self.coef = coef + [0] * (MAX_DEGREE - len(coef))

MAX_DEGREE = 101 # Maximum degree for the polynomial

# Function to add two polynomials A and B


def poly_add1(A, B):
# Initialize the result polynomial C with the maximum degree of A and B
C = Polynomial(max(A.degree, B.degree), [0] * MAX_DEGREE)

# Position indices for A, B, and C


Apos, Bpos, Cpos = 0, 0, 0
degree_a = A.degree
degree_b = B.degree

# Loop through the coefficients of A and B


while Apos <= A.degree and Bpos <= B.degree:
if degree_a > degree_b: # If the degree of A is greater than B
C.coef[Cpos] = A.coef[Apos] # Copy the coefficient from A to C
Apos += 1
degree_a -= 1
elif degree_a == degree_b: # If the degrees are the same
C.coef[Cpos] = A.coef[Apos] + B.coef[Bpos] # Add the coefficients
Apos += 1
Bpos += 1
degree_a -= 1
degree_b -= 1
else: # If the degree of B is greater than A
C.coef[Cpos] = B.coef[Bpos] # Copy the coefficient from B to C
Bpos += 1
degree_b -= 1
Cpos += 1

return C # Return the resulting polynomial C


# Function to print a polynomial
def print_poly(p):
poly_str = ""
# Loop through the coefficients and format them as a polynomial string
for i in range(p.degree):
poly_str += f"{p.coef[i]:3.1f}x^{p.degree - i} + "
poly_str += f"{p.coef[p.degree]:3.1f}" # Print the last term without 'x'
print(poly_str)

# Main function
if __name__ == "__main__":
# Define two polynomials a and b
a = Polynomial(5, [3, 6, 0, 0, 0, 10])
b = Polynomial(4, [7, 0, 5, 0, 1])

# Print polynomials a and b


print_poly(a)
print_poly(b)

# Add polynomials a and b, and store the result in c


c = poly_add1(a, b)

# Print a separator line


print("-----------------------------------------------------------------------------\n")

# Print the resulting polynomial c


print_poly(c)
Applications of Array and Structure : polynomial

To express polynomials #2

- Storing only non-zero terms in polynomials in an array

- (Coefficient, Degree) format be stored in an array

Example: 10x5+6x+3 → ((10,5), (6,1), (3,0))

#define MAX_TERMS 101


struct {
float coef;
int expon;
} terms[MAX_TERMS];
int avail;
Applications of Array and Structure : polynomial

Example

"A equals eight x cubed plus seven x plus one."


Applications of Array and Structure : polynomial

To express polynomials #2 (Homework)

#define MAX_TERMS 101


struct {
float coef;
int expon;
} terms[MAX_TERMS]={ {8,3}, {7,1}, {1,0}, {10,3}, {3,2},{1,0} };

int avail=6;

// Compare two interger


char compare(int a, int b)
{
if( a>b ) return '>';
else if( a==b ) return '=';
else return '<';
}
Applications of Array and Structure : polynomial

To express polynomials #2

// Add new polynomial.


void attach(float coef, int expon)
{
if( avail>MAX_TERMS ){
fprintf(stderr, “Too many degree\n");
exit(1);
}
terms[avail].coef=coef;
terms[avail++].expon=expon;
}
Applications of Array and Structure : polynomial

To express polynomials #2
// C = A + B
poly_add2(int As, int Ae, int Bs, int Be, int *Cs, int *Ce)
{
float tempcoef;
*Cs = avail;
while( As <= Ae && Bs <= Be )
switch(compare(terms[As].expon,terms[Bs].expon)){
case '>': // Degree of A > Degree of B
attach(terms[As].coef, terms[As].expon);
As++; break;
case '=': // Degree of A == Degree of B
tempcoef = terms[As].coef + terms[Bs].coef;
if( tempcoef )
attach(tempcoef,terms[As].expon);
As++; Bs++; break;
case '<': // Degree of A < Degree of B
attach(terms[Bs].coef, terms[Bs].expon);
Bs++; break;
}
Applications of Array and Structure : polynomial

To express polynomials #2

// A
for (; As <= Ae; As++)
attach(terms[As].coef, terms[As].expon);
// B
for (; Bs <= Be; Bs++)
attach(terms[Bs].coef, terms[Bs].expon);
*Ce = avail - 1;
}

void print_poly(int s, int e)


{
for (int i = s; i < e; i++)
printf("%3.1fx^%d + ", terms[i].coef, terms[i].expon);
printf("%3.1fx^%d\n", terms[e].coef, terms[e].expon);
}
Applications of Array and Structure : polynomial

To express polynomials #2

//
int main(void)
{
int As = 0, Ae = 2, Bs = 3, Be = 5, Cs, Ce; // As: A start, Ae: A end
poly_add2(As, Ae, Bs, Be, &Cs, &Ce);
print_poly(As, Ae);
print_poly(Bs, Be);
printf(“-----------------------------------------------------------------------------\n”);
print_poly(Cs, Ce);
return 0;
}
Pointer
※ The concept of pointer in C Language (1/4)
※ The concept of pointer in C Language (2/4)

char *p0=&language == char* p0=&language == char* p0;


p0 = &language;
※ The concept of pointer in C Language (3/4)
※ The concept of pointer in C Language (4/4)
Pointer

A variable that holds the address of another variable

char a='A';
char *p;
p = &a;
Address
26

26 ‘A’

Pointer p Variable a
Pointer

change the value what the pointer points to

: Using the * operator

*p= 'B';
Address
26

26 ‘B’

Pointer p Variable a
Pointer

pointer-related operators

& : extract the address of a variable


* : extract the contents of where the pointer points

Address
26

26 ‘B’

Pointer p Variable a
*p &a
Pointer

Array vs Pointer

The name of array → Pointer

== &A[0]
Pointer

Dynamic Memory Allocation

- Allocating memory during program execution

- Memory can be used very efficiently

main()
{
int *pi;
pi = (int *)malloc(sizeof(int));
// allocate dynamic memory
...
Heap ... // use
...
free(pi); // return
}
Pointer

Example of Dynamic Memory Allocation (practice)


#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define SIZE 10
int main(void)
{
int *p;
p = (int *)malloc(SIZE * sizeof(int));
if (p == NULL) {
fprintf(stderr, “No Memory.\n");
exit(1);
}
for (int i = 0; i<SIZE; i++)
p[i] = i;
for (int i = 0; i<SIZE; i++)
printf("%d ", p[i]);
free(p);
return 0;
}
Pointer

Execution Result

0123456789
Pointer

Structure and Pointer

(*ps).i X

ps->I O
Pointer

Example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct studentTag {


char name[10];
int age;
double gpa;
} student;

int main(void)
{
student *p;
p = (student *)malloc(sizeof(student));
if (p == NULL) {
fprintf(stderr, “not enough memory.\n");
exit(1);
}
Pointer

Example

strcpy(p->name, "Park");
p->age = 20;
free(s);
return 0;
}
Recursion
Recursion반복, 되풀이

□ Recursion ?

- A technique in which an algorithm or function


calls itself again during execution to solve a problem.

- Appropriate method when the definition itself is circular

Dream within a Dream


suggests that what we perceive as
reality might itself be another dream,
hinting at the elusive nature of truth
and existence.

“GNU"
GNU는 "GNU's Not Unix!“ (GNU는 유닉스가 아닙니다!)의 약자
GNU is a free software operating system that was
launched by Richard Stallman in 1983.

재귀함수 (再歸函數)
Recursion

solution for n=3

A B C A B C

A B C A B C

A B C A B C

A B C A B C
Recursion

General Approach ??

n-1 disks
1 disk
Using C as a temporary buffer,
A B C n-1 disks stacked in A are
transferred to B.

A B C
Move the largest disk from A to C.

A B C
Using A as a temporary buffer,
n-1 disks stacked in B are
transferred to C.

A B C
Recursion
General Approach ??
Now, how do we move n-1 disks from A to B and from B to C?

(Hint) Remember that our original problem is to move n disks from A to C.


Therefore, We can cycle call by changing the parameter of the function writing to n-1.

// Move the n disks stacked on the rod from to the rod to using the rod tmp.
void hanoi_tower(int n, char from, char tmp, char to)
{
if (n==1){
Move the disk from from to to.
}
else{
hanoi_tower(n-1, from, to, tmp);
move one disk from from to to.
hanoi_tower(n-1, tmp, from, to);
}
}
Recursion
Tower of Hanoi Program

#include <stdio.h>
void hanoi_tower(int n, char from, char tmp, char to)
{
if( n==1 ) printf(“move disk 1 from %c to %c.\n”, from,to)
else {
hanoi_tower(n-1, from, to, tmp);
printf(“move disk %d from %c to %c,\n”,n,from,to);
hanoi_tower(n-1, tmp, from, to);
}
}

int main(void)
{
hanoi_tower(4, 'A', 'B', 'C');
retrun 0;
}
Tower of Hanoi

For reference,
Assuming that the time is 1 second to move one time,

It takes about 18,446,744,073,709,551,615 moves


to move 64 discs, and that means
it takes 584.942,417,355 years to move 64 discs.
3rd week : Stack

Think about programming of


maze exploration
Maze Exploration
Need a systematic way
1.The possible directions from the current position are stored on the stack,
and
2. when a dead end is encountered, the next search position is retrieved
from the stack.
IT Common Senses
IT Vocabulary
English word - OTT

- OTT : Over The Top

. Terminology from American Army. (General – private directly)

. where orders are given directly from a higher commanding

authority (General) to lower-ranking soldiers (Private),

bypassing the traditional hierarchy or intermediate steps.

. Netflix services directly without Telecommunication company

. Netflix, YouTube, Disney+,


Alien code

※ Alien code (spaghetti code)

- a pejorative phrase for unstructured and


difficult-to-maintain source code.

- Alien code can be caused by several factors,


such as volatile project requirements,
lack of programming style rules,
and software engineers with insufficient ability or experience

1. Netscape
2. LOL(League of Legend)
3. Minecraft (Java edition)
4. Dungeon Fighter
are all developed under complex requirements, continuous
updates, and changing environments, the potential for code
complexity is very high.
Richard Matthew Stallman (RMS)

- Born March 16. 1953

- Free S/W movement activist and programmer

- Launched GNU Project


· founded free S/W Foundation in 1985
· “copyleft(copyright)”
(GPL(General Public License) widely used in free)
· Emacs, debugger(GDB), compiler(GCC)

- “Free is not a free of charge but a freedom”

Stallman using his Lemote machine


at Indian Institute of Technology
Madras, Chennai
Larry Ellison

1. Founder of the Oracle Larry Ellison (1944 ~)


(Lawrence Joseph Ellison)
2. Appeared as a cameo in Iron Man 2

3. Acquisition of 3 million Tesla shares

4. 4 marriages and divorces

Acquisition of Lanai Island, Hawaii

RDB proposed by IBM's Edgar Codd

Codd: Founder of SQL


Top 10 Programming Language in 2023
The node with large number of edges represents the
number of influence it has
05. Top 10 of Programming Language (2023)

- TIOBE Index

· Survey of programming language (2023.03)


https://www.tiobe.com/tiobe-index
05. Top 10 of Programming Language (2023.03)

#10 Go
- A programming language officially announced by Google

- Apple .vs. MicroSoft .vs. Oracle .vs. Goole


(Swift) (C#) (Java) (Go)

* Object Oriented Programming

- Compiler language (not interpreter)

- Aiming for simplicity and practicality,


only 25 keywords are used in the language.

Package main

Import “fmt”

func main() {
fmt.Println(“Hello world”)
}
05. Top 10 of Programming Language (2023.03)

#9 PHP
- Dirty old php
* Adult language in the programming world (adult site)
→ Developed ad hoc
→ The most popular server-side web programming language
* Wikipedia, wordprocess, facebook, … run on PHP

- PHP is a general-purpose scripting language geared toward web development.


- It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995.
- The PHP reference implementation is now produced by The PHP Group.
- PHP was originally an abbreviation of Personal Home Page,
but it now stands for the recursive initialism PHP: Hypertext Preprocessor
- PHP code is usually processed on a web server by a PHP interpreter
implemented as a module, a daemon or as a Common Gateway Interface (CGI) executable.
- PHP can be used for many programming tasks outside the web context, such as standalone graphical
applications and robotic drone control.
- PHP code can also be directly executed from the command line.

<?php
echo “Hello World”;
?>
05. Top 10 of Programming Language (2023.03)

#8 SQL
- Structured Query Language, abbreviated as SQL (S-Q-L),
sometimes /ˈsiːkwəl/ "sequel" for historical reasons is a
domain-specific language used in programming and
designed for managing data held in a relational database
management system (RDBMS), or for stream processing in a
relational data stream management system (RDSMS). It is
particularly useful in handling structured data, i.e. data
incorporating relations among entities and variables.

- SQL became a standard of the American National Standards


Institute (ANSI) in 1986 and of the International Organization
for Standardization (ISO) in 1987.

SELECT “Hello World”

SELECT * FROM table name


05. Top 10 of Programming Language (2023.03)

#7 JavaScript
- JavaScript (/ˈdʒɑːvəskrɪpt/), often abbreviated as JS, is a programming
language that is one of the core technologies of the World Wide Web,
alongside HTML and CSS. As of 2022, 98% of websites use JavaScript
on the client side for webpage behavior, often incorporating third-
party libraries. All major web browsers have a dedicated JavaScript
engine to execute the code on users' devices.

- JavaScript is a high-level, often just-in-time compiled language.

- Be invented in 1995, for Netscape browser


* Todays not only for browser but server with nodejs (frontend code)
* libraries like react, vue, angular
* Interpreter language

- HTML, CSS (dynamic function)


* After Google’s Ajax, JavaScript was booming

consol.log(“Hello World”);
05. Top 10 of Programming Language (2023.03)

#6 Visual Basic
- Not like Basic in 60’s

* MicroSoft invented
* OOP embedded for Windows system
05. Top 10 of Programming Language (2023.03)

#5 C#
- Developed in 2000 (from MS)

- Compete with Java (Object Oriented)


* C + Java

- C# means C++++ , drag & drop

- MicroSoft.net platform
05. Top 10 of Programming Language (2023.03)

#4 C++
- Extension of C
· Objected Oriented Program paradigm added to C

- Game Engine, Photo shop

#include <iostream>
using namespce std;

Int main(void) {
cout<<“Hello World”<<endl;
return 0
}
05. Top 10 of Programming Language (2023.03)

#3 Java
- Developed in 1995 (SUN → Oracle), also C type language
- JVM (bytecode), Hybrid type (Compile + Interpreter)
* Machine independent, compatibility, scalability
- Basically Object Oriented Programming

- Easy to use thread process


- Too many reference
- Android apps, Mobile

* 6 lines needed to make “hello world”

public class HelloWorld {


public static void main(String[] args) {
System.out.println(“Hello World”);
}
05. Top 10 of Programming Language (2023.03)

#2 C
- Spirit : “Trust the programmers”

- Low level Compiled Language & Procedure Oriented


(well-fit or Data Structure and Algorithm)

* Easy to understand the concept of H/W & Programming


* Fast runtime code (ASM)
* Pointer, east to manage memory
* IoT
* C language has few features and simple syntax.

- Weakness

* Security
* Programmer’s mistake
#include <stdio.h>
main() (
printf (“Hello World\n”);
}
# Spirit of the C language

- Trust the programmer

RUST : “Strict compilation to prevent programmers from writing weird code”

- Don't prevent the programmer from doing what needs to be done

- Keep the language small and simple

- Provide only one way to do an operation

- Make it fast, even if it is not guaranteed to be portable


05. Top 10 of Programming Language (2023.03)

#1 Python
- Developed in 1991.

- All features embedded (General + OOP + FP + Recursive)

- Can be used for Data Science, AI, ML, and Web app development

- YouTube developed with Python

- Web site

- Easy to learn (syntax is human readable)

- Fast to write code in Python (2 lines to sort) but Very slow


(write time speed is more important than run time speed)

print (“Hello World”)


# Python
- Its core philosophy is summarized in the document The Zen선(일본식 불교), (불
교의) 선종 of Python (PEP 20), which includes aphorisms such as:[73]

Beautiful is better than ugly.


Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Readability counts.

** Indentation
05. Top 10 of Programming Language (2023.03)

# Others

R -
-
Statistic oriented (developed in NZ)
There are a lot of package, chart, picture,
- Big data, ML
- Much more powerful than SAS, …
Thank You
엔디컷 대학 / AI-빅데이터학과
E-Mail: [email protected]
전 화: 010-2329-8055

You might also like