Shohret

この世界が間違っている


  • Home

  • Categories

  • Archives

  • Tags

  • About

  • Search

يىللارغا جاۋاپ

Posted on 04-15-2018 | In Language & Literature , Uyghur |

ﻟﯘﺗﭙﯘﻟﻼ ﻣﯘﺗﻪﻟﻠﯩﭗ

ۋاقىت ئالدىراڭغۇ ساقلاپ تۇرمايدۇ،
يىللار ۋاقىتنىڭ ئەڭ چوڭ يورغىسى.
ئاققان سۇلار، ئاتقان تاڭلار قايتىلانمايدۇ،
يورغا يىللار ئۆمۈرنىڭ يامان ئوغرىسى.

Read more »

BFS & DFS

Posted on 04-13-2018 | In Computer Science , Algorithm |

Breadth-first Search

  • Running time complexity: O(V + E)
  • Memory complexity is not good as we have to sort lots of references. That is why DFS is usually preferred.
  • But it constructs a shortest path: Dijkstra algorithm does a BFS if all the edge weights are equal to one.
  • We have an empty queue at the beginning and we keep checking whether we have visited the given node or not. Keep iterating until queue is not empty.
    Read more »

Basic Sorting Algorithms

Posted on 03-09-2018 | In Computer Science , Algorithm |

Some Features

Time Complexity
Typical ones are: O(n^2) or O(nlogn) or O(n), for more check Big-O Cheatsheet.
In-place
Strictly an in-place sort needs only o(1) memory beyond the items being sorted.
So an in place algorithm does not need any extra memory.
Recursive
Some sorting algorithms are implemented in a recursive manner, especially the divide and conquer ones. Such as merge sort and quick sort.
Stable
Stable sorting algorithms maintain the relative order of records with equal values.

Read more »

Heap Implementation

Posted on 02-27-2018 | In Computer Science , Data Structure |

Priority Queue

  • It is an abstract data type such as stack or queue
  • But every item has an additional property: a priority value
  • Priority Queue is usually implemented with heaps, but it can be implemented with self balancing trees as well
  • The highest priority element is retrieved first, no FIFO structure here
  • Operation: InsertWithPriority(data, priority), getHighestPriorityElement(), peek()
Read more »

Trees Implementation

Posted on 02-01-2018 | In Computer Science , Data Structure |

Binary Search Tree

Average Case Worst Case
Space O(n) O(n)
Insert O(log(n)) O(n)
Delete O(log(n)) O(n)
Search O(log(n)) O(n)
Read more »

How to Use ~ば

Posted on 01-29-2018 | In Language & Literature , Japanese |

The conditional 〜ば form changes differently in these word types: 『動詞』(verb)、『い形容詞』(i adjective)、『な形容詞』(na adjective)、そして『名詞』(noun)。
And 『動詞』(verb) will include three different categories: u verb, ru verb, and exceptions.

Read more »

Stack & Queue Implementation

Posted on 01-16-2018 | In Computer Science , Data Structure |

Stack and queue abstract data types implementation with Python.

Stack

  • LIFO structure
  • Graph algorithm: depth-first search can be implemented with Stack
  • Finding Euler-cycles in a Graph
  • Finding strongly connected components in a graph
  • If we use recursion, the OS will use stacks
    Read more »
12
Shohret

Shohret

14 posts
10 categories
32 tags
Instagram
© 2017 — 2020 Shohret
0%