Moyazine

日々の学習と生活の記録

データ構造・アルゴリズム

AIと行くIT世界の旅 #29: k-means法

クラスタリングってなんか格好いい。 1. Please explain k-means in a way that even elementary school students can understand. 2. What is the time complexity of this algorithm? k-means 3. Please visually explain k-means 4. Explain applications…

AIと行くIT世界の旅 #27: A* アルゴリズム

1. Please explain A* algorithm in a way that even elementary school students can understand. 2. Explain how A* algorithm works 3. What is the time complexity of this algorithm? 4. Please visually explain A* 5. Explain applications and use …

ChatGPTと行くIT世界の旅 #26: ダイクストラ法

今日の記録。 1. Please explain Dijkstra's algorithm in a way that even elementary school students can understand. 2. Explain how Dijkstra's algorithm works 3. What is the time complexity of this algorithm? Dijkstra's algorithm 4. Please vi…

AIと行くIT世界の旅 #25: ベルマン-フォード法

1. Please explain Bellman-Ford algorithm in a way that even elementary school students can understand. 2. Explain how Bellman-Ford algorithm works 3. What is the time complexity of this algorithm? Bellman-Ford algorithm 4. Please visually …

AIと行くIT世界の旅 #24: 深さ優先探索/DFS

Please explain DFS in a way that even elementary school students can understand. Explain how DFS works What is the time complexity of this algorithm? DFS Please visually explain DFS Please explain Ruby implementation DFS このコードをリファ…

AIと行くIT世界の旅 #23: 幅優先探索

Please explain BFS in a way that even elementary school students can understand. Algorithm explanation: "Explain how BFS works” Time complexity: "What is the time complexity of this algorithm? BFS Please visually explain graph theory. Plea…

AIと行くIT世界の旅 #22: グラフ理論

最近は生成データも長くなって疲れるし焦点がボヤける気がした。 だからちょっと今回は軽めに聞いてみることにする。 Please explain graph theory in a way that even elementary school students can understand. Please visually explain graph theory. P…

AIと行くIT世界の旅 #21: 二分探索

二分探索について 0. 二分探索を小学生でもわかりやすく説明してみて 1. はじめに 1.1 二分探索の概要 1.2 二分探索の歴史と背景 2. 二分探索の基本概念 2.1 二分探索とは 2.2 アルゴリズムの手順 2.3 時間計算量 2.4 Rubyでの実装 2.5 図や表で視覚的に理解…

AIと行くIT世界の旅 #20: 線形探索アルゴリズム

線形探索アルゴリズムについて 1. はじめに 1.1 線形探索とは 1.2 背景と歴史 2. 主要な概念 2.1 線形探索の定義 2.2 アルゴリズムの手順 2.3 時間複雑度 2.4 Rubyによる実装 2.5 視覚的な説明 3. 分析と応用 3.1 線形探索の長所と短所 3.2 使用例と応用 3.3…

AIと行くIT世界の旅 #19: 計算時間の求め方と表し方

軽い気持ちで始めたらとんでもないことになった。 計算時間の求め方 計算時間の表し方 O記法について (前述のO記法に対して)これらはどのようなアルゴリズムで使われるの?step by stepで解説して アルゴリズムのオーダー記法を図で説明できる? O記法につい…

ChatGPTと行くIT世界の旅 #18: クイックソート

クイックソートアルゴリズムについて はじめに クイックソートとは アルゴリズムのステップ 時間計算量 Rubyによる実装 クイックソートの特徴 まとめ コードをリファクタリングしたい リファクタリング後のコードについて解説して less << element について…

ChatGPTと行くIT世界の旅 #17: マージソート

ChatGPTと対話しながらIT技術を学ぶ。 第17回はマージソートについて。 はじめに マージソートとは アルゴリズム手順 時間計算量 Rubyでの実装 まとめ 質疑応答 Lint Style/FrozenStringLiteralComment: Missing frozen string literal comment.RuboCop(Styl…

ChatGPTと行くIT世界の旅 #14: ヒープソート

はじめに ヒープソートとは アルゴリズムの手順 時間計算量 Rubyによる実装 まとめ 解説 疑問点 Lint Style/SymbolProc: Pass &:to_i as an argument to map instead of a block.R Metrics/AbcSize: Assignment Branch Condition size for heapify is too hi…

ChatGPTと行くIT世界の旅: データ構造 #13 挿入ソート

はじめに 挿入ソートとは アルゴリズムの手順 時間計算量 Rubyでの実装 配列が[33, 43, 2, 55, 9999]の場合で説明してみて (1...n)だからn-1回ループでいいんだよね はじめに 挿入ソートは、シンプルで分かりやすいアルゴリズムです。 この記事では、挿入ソ…

ChatGPTと行くIT世界の旅 #12: 選択ソート

Introduction: What is Selection Sort? Algorithm Steps Time Complexity Ruby Implementation Conclusion: Prompt My Question Q1. time complexity を時間計算量と時間複雑度のどっちで訳す? Q2. (i + 1...n).each do |j| and (i + 1..n).each do |j| In…

ChatGPTと行くInformation Technologyの旅 #10 Bubble Sort

Introduction: Bubble Sort is a simple, yet inefficient, sorting algorithm that compares adjacent elements in a list and swaps them if they are in the wrong order. This process is repeated until the list is sorted. In this blog post, we wil…

ChatGPTと行くインフォメーションテクノロジーの旅 #9 ハッシュテーブル

Introduction: Overview of Heap Data Structures: Use Cases for Heap Data Structures: Code Example 解説 Q1. shift_upメソッドの解説 Q2. 配列要素の入れ替え Q3. どのような原理で入れ替えている Q4. @heapの@はどういう意味? Q5. @heapとheapは何が違…

ChatGPTと行くインフォメーションテクノロジーの旅 #8 本のタイトルと章数からディレクトリとMarkdownファイルを生成するzshスクリプト

を書いた。ChatGPTが。 目的とか 先日読んだt_wadaさんのように読書記録をリポジトリ管理したかった。 だが、いちいちmkdirしてtouchしてって工程が面倒臭かったので、楽がしたかった。 なんとなく出来そうだけど、具体的なコードが思いつかなかったのでChat…

ChatGPTと行くインフォメーションテクノロジーの旅 #7 ハッシュテーブル

しれっとタイトルと言語設定を変える。 例の如くChatGPTに聞いてみたら Journey into the World of Programming: Exploration of Computer Science and Software Engineering といういい感じのタイトルがサジェストされたので。副題は長いからいいかなと。 …

ChatGPTと行くインフォメーションテクノロジーの旅 #6 Data Structures Pt.4 Tree

Summary A tree is a hierarchical data structure made up of nodes connected by edges, with the root node at the top and child nodes below. Nodes with the same parent are called siblings. Trees can have zero or more child nodes, and each chi…

ChatGPTと行くインフォメーションテクノロジーの旅 #5 Data Structures Pt.3 Stack and Queue

Sammary This text provides an overview of two common data structures used in computer programming: stack and queue. コンピューター プログラミングで使用される 2 つの一般的なデータ構造であるスタックとキューの概要を説明します A stack stores e…

ChatGPTと行くインフォメーションテクノロジーの旅 #4 Data Structures Pt.2 Linked List

続いた。 Linked List in a nutshell. 連結リストについて完結に説明して A linked list is a data structure that stores a collection of elements where each element, called a node, points to the next element in the list using a pointer. It consi…

ChatGPTと行くインフォメーションテクノロジーの旅 #3 Data Structures Pt.1 Array

This guy changes what he says so easily. こいつすぐ言ってること変わるな。 I crammed it in because I wanted to learn both English and Programming. 英語もプログラミングも勉強したいから詰め込んでみた。 I asked ChatGPT about the array. ChatGPT…

ChatGPTと行くインフォメーションテクノロジーの旅 #2 ゴゴゴッ!ChatGPTからのコーディング問題でプログラミング力を鍛える!

また遊んでみた。 ChatGPTからコード問題を出してもらうことをブログの題材にしたい。いいタイトルない? 以下のようなタイトルが考えられます。 「ChatGPTによるコーディング問題が学びを加速させる!」 「ChatGPTが提供するコーディング問題でプログラミン…

ChatGPTと行くインフォメーションテクノロジーの旅 #1 データ構造 Pt.1

新企画。 コンセプト 毎日のアウトプット ソフトウェアエンジニアとしてサヴァイブするのが目的。200%自分のため。 ChatGPTで遊びたい! 職場じゃ使えないし。 なるべく手軽でサクッと。 継続優先。継続が一番難しい。簡単でもいい。でも学びのある内容で。 …