From d39bb36216ba896096cc1a9f61f09b14002b59e5 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Thu, 31 Mar 2022 12:17:33 -0500 Subject: Add more usage instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62a88fe..676065f 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ Very efficient flash cards app using Go and SQLite Flash cards are stored in the `cards` table of a SQLite database. There are four columns: `idx INTEGER PRIMARY KEY, weight INTEGER, key STRING, val STRING`. The `idx` is a unique index for each card, starting at 0. The weight is how often the card should come up. The key and value are the front and reverse sides of the card. You can use the `sqlite3` CLI to create a card deck. -Now build this project with `go build` and run `./sd` to enjoy a fast flash cards experience! +Now build this project with `go build` and run `./sd` to enjoy a fast flash cards experience! The program will display the `key` of a randomly selected card. Press any key to show the `val` of the card. Now press either `y` or `n` depending on whether you got the card correct, and the program adjusts that card's weight. If you're wondering where the name came from, I named this app after a common type of flash card. 😀 ## Performance -SD is designed to be extremely efficient in order to support a very large number of flash cards and should be able to handle millions of cards with ease. If `N` is the number of cards, initializing the program requires `O(N)` time and `O(N)` memory. Selecting a random card and adjusting its weight based on if the user got it correct requires `O(log N)` time. Internally SD uses [segment trees](https://en.wikipedia.org/wiki/Segment_tree) to achieve this time complexity. +SD is designed to be extremely efficient in order to support a very large number of flash cards and should be able to handle millions of cards with ease. If `N` is the number of cards, initializing the program requires `O(N)` time and `O(N)` memory. Selecting a random card and adjusting its weight requires `O(log N)` time. Internally SD uses [segment trees](https://en.wikipedia.org/wiki/Segment_tree) to achieve this time complexity. A C port for maximal speed and minimal executable size is planned but will probably never happen. -- cgit v1.2.3-70-g09d2