Skip to content

Instantly share code, notes, and snippets.

View Aydana1's full-sized avatar
🎯
Focusing

Aidana N Aydana1

🎯
Focusing
View GitHub Profile
@Aydana1
Aydana1 / Main.java
Created December 29, 2018 14:48
EvergreenMerryMethod created by AidanaNurakhmet - https://repl.it/@AidanaNurakhmet/EvergreenMerryMethod
class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
next = null;
}
}
@Aydana1
Aydana1 / utility-functions.prolog
Created October 26, 2018 06:46 — forked from raskasa/utility-functions.prolog
All useful Prolog functions learned over the course of the semester in CS 341 - Programming Languages.
% Contained within are all the useful Prolog functions learned in CS 341 this past semester (Fall 2012).
% NOTE: Any functions used that are not defined in this file are built-in functions.
% length(+As,-N)
% returns in N the length of the list As
length([],0).
length([A|As],N) :- length(As,M), N is M+1.
% append(+As,+Bs,-Cs)
% returns in Cs the append of lists As and Bs
@Aydana1
Aydana1 / The Technical Interview Cheat Sheet.md
Created October 16, 2018 10:59 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@Aydana1
Aydana1 / UCF.cpp
Created September 13, 2018 18:17 — forked from sameer-j/UCF.cpp
Uniform Cost Search Algorithm C++ Implementation
//Algorithm:
// Insert the root into the queue
// While the queue is not empty
// Dequeue the maximum priority element from the queue
// (If priorities are same, alphabetically smaller path is chosen)
// If the path is ending in the goal state, print the path and exit
// Else
// Insert all the children of the dequeued element, with the cumulative costs as priority
//url: https://algorithmicthoughts.wordpress.com/2012/12/15/artificial-intelligence-uniform-cost-searchucs/
#include <iostream>
@Aydana1
Aydana1 / gist:7a42f72e49d9652c6d5cd22bf5d92cf9
Created September 4, 2018 12:09 — forked from ranacseruet/gist:7379890
Binary Tree Traversal In LISP(Preorder,Inorder & PostOrder)
(defparameter *tree2* '(40 (30 (25 () ()) (35 () ())) (60 (50 () ()) ())))
(defparameter *tree* '(3 (2 (1 () ()) ()) (5 () ())))
;validate if given parameter is a binary tree or not
(defun is-tree(tree)
(cond
((null tree) NIL)
((< (list-length tree) 3) NIL)
(t)
)
@Aydana1
Aydana1 / client.c
Created April 21, 2018 12:44 — forked from Alexey-N-Chernyshov/client.c
Example of client/server with select().
// Simple example of client.
// Client prints received messages to stdout and sends from stdin.
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/select.h>
#include <netinet/in.h>
@Aydana1
Aydana1 / tcp_server.c
Created April 2, 2018 16:19 — forked from oleksiiBobko/tcp_server.c
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>