Giter Site home page Giter Site logo

datastructer's Introduction

Hi there ๐Ÿ‘‹

datastructer's People

Contributors

forteescape avatar

Watchers

 avatar  avatar

datastructer's Issues

Week2 Problem 5

๋ฌธ์ œ 5๋ฒˆ ๊ด€๋ จ ์ด์Šˆ

ํ˜„์žฌ ๊ตฌํ˜„๋œ ๊ธฐ๋Šฅ

  • file์„ ์ฝ์–ด ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ ์ž˜๋ผ ๋‹จ์–ด๋ฅผ ํฌ์ธํ„ฐ ๋ฐฐ์—ด char* str[] ์— ๋„ฃ์–ด๋‘๋Š” ๊ธฐ๋Šฅ
  • file์„ ํ•œ์ค„์”ฉ ์ฝ์–ด๋“ค์ธ ์‹œ์ ์—์„œ ์†Œ๋ฌธ์žํ™” ์‹œ์ผœ๋†“๋Š” ๊ธฐ๋Šฅ

์ถ”๊ฐ€ํ•ด์•ผํ•  ๊ธฐ๋Šฅ

  • ํฌ์ธํ„ฐ ๋ฐฐ์—ด char* str[] ์— ๋„ฃ๊ธฐ ์ด์ „์— ํŠน์ˆ˜๋ฌธ์ž๋“ค (ex) ~`!@#$%^&*()-_+=/?.,<>;:"' '๊ณต๋ฐฑ') ์ œ๊ฑฐ
  • ๊ฐ€๊ณต๋œ char* str[] ์„ ์ •๋ ฌ โ†’ bubble sort?, quick sort?, merge sort?
  • ์ •๋ ฌ๋œ char* str[] ์—์„œ ๊ธธ์ด 7 ์ด์ƒ์ธ ๋ชจ๋“  ๋‹จ์–ด๋ฅผ ๊ฐ€์ ธ์™€ ๊ทธ ๋นˆ๋„์ˆ˜ ์ถœ๋ ฅ ๋Œ€์ถฉ ์•„๋ž˜์™€ ๊ฐ™๊ฒŒ...
...
int count = 0;
if(strlen(str[i]) >= 7){ // ๋„ˆ๋ฌด ๋น„ํšจ์œจ์ ์ธ ๋ฃจํ”„๊ฐ€ ๊ณ„์† ๋ฐœ์ƒ
    for(int j = 0; j<idx; i++){
        if(strcmp(str[i], str[j]) == 0){
            count++;
        }
    count_arr[i] = count;
    count = 0;
}
...

์ƒ๊ฐํ•ด๋ณด๋ฉด ์ข‹์„๊ฒƒ ๊ฐ™์€๊ฒƒ๋“ค

  • ๋‚ ์ฝ”๋”ฉ์œผ๋กœ ํ•˜์ž๋ฉด ์ €๋ ‡๊ณ  ์‹œ๊ฐ„๋ฉด์—์„œ ์ด๋“์„ ๋ณด๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ถ”๊ฐ€๋˜๋Š” ์‹œ์ ์— ์ค‘๋ณต๊ฐœ์ˆ˜๋ฅผ ๋ด์•ผํ• ๋“ฏ

  • ์ถ”๊ฐ€๋˜๋Š” ์‹œ์ ์— ๊ฑฐ์˜ ๋ชจ๋“  ์ฒ˜๋ฆฌ๋ฅผ ๋ชฐ์•„๋„ฃ์œผ๋ฉด ์‹œ๊ฐ„์  ์ด๋“์ด ์žˆ์„์ˆ˜๋„?
    (ex ๋‹จ์–ด์˜ ๋นˆ๋„์ˆ˜ ๊ณ„์‚ฐ, ๋‹จ์–ด๊ธธ์ด 7์ด์ƒ์ธ ๋‹จ์–ด๋“ค์„ ์•„์˜ˆ ๋”ฐ๋กœ ๋นผ๋˜์ง€...)

  • ์•„์‹ธ๋ฆฌ ๋นˆ๋„์ˆ˜์™€ ๋‹จ์–ด๋ฅผ key-value๋กœ ๋ฌถ์„ ์ˆ˜ ์žˆ๊ฒŒ struct๋ฅผ ์งœ๋ณด๋Š”๊ฒƒ๋„ ๋‚˜์˜์ง€๋Š” ์•Š์„๊ฒƒ ๊ฐ™๋‹ค. ์•„๋ž˜์ฒ˜๋Ÿผ...

typedef struct{
    char words[100];
    int count;
}answer;
...

int main(){
    answer ansArr[100];
    ...
}

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.